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. CFtpConnection::SetCurrentDirectory()

CFtpConnection::SetCurrentDirectory()

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomsysadmin
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.
  • T Offline
    T Offline
    Tony Fontenot
    wrote on last edited by
    #1

    What is this function used for?:-D No seriously, I have been playing around with CFtpConnection, specifically PutFile, and I have found that i need to specify exacly where the file should be placed on the server. I tried to use SetCurrentDirectory but to no avail. The functions returns success but when I just put the file name in PutFile it transfers it to the root. To me SetCurrentDirectory should let me put just the file name(no path) in PutFile. So my question is. Am I doing it wrong and SetCurrentDirectory should work the way I want it to, or am I suck with PutFile with the Path\FileName. Thanks in advance *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

    T J T 3 Replies Last reply
    0
    • T Tony Fontenot

      What is this function used for?:-D No seriously, I have been playing around with CFtpConnection, specifically PutFile, and I have found that i need to specify exacly where the file should be placed on the server. I tried to use SetCurrentDirectory but to no avail. The functions returns success but when I just put the file name in PutFile it transfers it to the root. To me SetCurrentDirectory should let me put just the file name(no path) in PutFile. So my question is. Am I doing it wrong and SetCurrentDirectory should work the way I want it to, or am I suck with PutFile with the Path\FileName. Thanks in advance *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

      T Offline
      T Offline
      Tom Archer
      wrote on last edited by
      #2

      That's definitely strange because I've written a very basic FTP client and it works fine. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.

      1 Reply Last reply
      0
      • T Tony Fontenot

        What is this function used for?:-D No seriously, I have been playing around with CFtpConnection, specifically PutFile, and I have found that i need to specify exacly where the file should be placed on the server. I tried to use SetCurrentDirectory but to no avail. The functions returns success but when I just put the file name in PutFile it transfers it to the root. To me SetCurrentDirectory should let me put just the file name(no path) in PutFile. So my question is. Am I doing it wrong and SetCurrentDirectory should work the way I want it to, or am I suck with PutFile with the Path\FileName. Thanks in advance *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

        J Offline
        J Offline
        Joao Vaz
        wrote on last edited by
        #3

        It worked perfectly for me, you tried using GetCurrentDirectory and then set the path relatively with SetCurrentDirectory ? What was the error that GetLastError() reports ? x = GetLastError(); Better put the variable x on the watch window with the modifier hr like this: x,hr what the error says ? See this on this page for a basic ftp tool using wininet : Some tips Cheers, Joao Vaz Frustrated TCL programmer,good c++ programmer wannabe

        1 Reply Last reply
        0
        • T Tony Fontenot

          What is this function used for?:-D No seriously, I have been playing around with CFtpConnection, specifically PutFile, and I have found that i need to specify exacly where the file should be placed on the server. I tried to use SetCurrentDirectory but to no avail. The functions returns success but when I just put the file name in PutFile it transfers it to the root. To me SetCurrentDirectory should let me put just the file name(no path) in PutFile. So my question is. Am I doing it wrong and SetCurrentDirectory should work the way I want it to, or am I suck with PutFile with the Path\FileName. Thanks in advance *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

          T Offline
          T Offline
          Tony Fontenot
          wrote on last edited by
          #4

          Got it working thanks all :-O *********************** Tony Fontenot Recreational Solutions tony@recsolutions.com ***********************

          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