Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to upload a file on a server at a perticular location?

how to upload a file on a server at a perticular location?

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminhelptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AnayKulkarni
    wrote on last edited by
    #1

    Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni

    J D 2 Replies Last reply
    0
    • A AnayKulkarni

      Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni

      J Offline
      J Offline
      Jason Teagle
      wrote on last edited by
      #2

      I believe you should add it to the 'pstrRemoteFile' parameter of the PutFile() / GetFile() calls instead of to the server address. Instead of asking for myfile.txt ask for subdir1/subdir2/myfile.txt See if that works for you.

      A 1 Reply Last reply
      0
      • J Jason Teagle

        I believe you should add it to the 'pstrRemoteFile' parameter of the PutFile() / GetFile() calls instead of to the server address. Instead of asking for myfile.txt ask for subdir1/subdir2/myfile.txt See if that works for you.

        A Offline
        A Offline
        AnayKulkarni
        wrote on last edited by
        #3

        yes, it worked fine. thanks a lot sir. Anay

        1 Reply Last reply
        0
        • A AnayKulkarni

          Hello to all, right now i am trying to upload a file on the server in VC++(MFC), currently i can upload a file directly on the server but i want to upload a file in a perticular folder on the server that i am unable to do, bcoz whenever i add that folder name to the our server address in the code then after execution i get a message "server name or address can not be resolved" and so connetion with server can not be done. I am using CInternetSession and CFtpConnection classes and GetFtpConnection(),PutFile() and GetFile() functions of these classes for uploading and downloading. can anybody help me? Anay Kulkarni

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Are you calling the connection's SetCurrentDirectory() method before PutFile()?


          "A good athlete is the result of a good and worthy opponent." - David Crow

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups