Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:24:54+00:00 2026-05-26T06:24:54+00:00

pConnect->SetCurrentDirectory( C:\\FilesToSendToServer ); //Need this set on client, i believe currently setting on server.

  • 0
pConnect->SetCurrentDirectory( "C:\\FilesToSendToServer" ); //Need this set on client, i believe currently setting on server.
CFtpFileFind finder(pConnect);
finder.FindFile( "*", INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_EXISTING_CONNECT );
finder.FindNextFile();
CString filename = finder.GetFileName(); //finds the only file in that directory - test.txt

pConnect->PutFile( filename, "C:\\FilesReceived\\FILE_SENT_FROM_CLIENT.txt", FTP_TRANSFER_TYPE_BINARY, 1 )) //filename set to test.txt correctly

On the client I have the directory FilesToSendToServer with one test file – “test.txt”

I also have the working directory of this application on the client – C\uploadApp\

The code above sets the current directory correctly and “finds” the test file.

However, when PutFile executes with the filename parameter set correctly (test.txt) the functin returns the error file not found.

So as a test, I put a copy of test.txt in the applications working directory uploadApp and it DID send the file to the server.

Why does the file need to be in the working directory to be sent if the active directory is set in the CFtpConnection object?

(Does this mean for any file I want to send from the client I have to copy it over to the directory of the application?)

Thank You.

EDIT
Looks like SetCurrentDirectory calls FtpSetCurrentDirectory which

determine the remote site’s current working directory

So for a GET this would make sense…is there an alternate function for a PUT – to set the active directory of the local machine? (FYI – Unable to make a distinction between the remote directory on the server testing on same machine…if testing on target the SetCurrentDirectory should fail, as it is looking on the server…I assume)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:24:55+00:00Added an answer on May 26, 2026 at 6:24 am

    It looks like you were meaning to call the win32 API SetCurrentDirectory. This will change the local directory instead of the remote directory that pConnect->SetCurrentDirectory changes. Try ::SetCurrentDirectory if you’re in a namespace. Of course your working directory will no longer be C:\uploadApp…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just a quick question. Say a call a method like so mysql_pconnect(server,tator_w,password) or die(Unable
It is know that connection to the SQL server will not be closed when
I've a python script which works just as it should, but I need to
I have a standard php app that uses SQL Server as the back-end database.
I run a server that is getting killed by the number of requests it
One of the parameters in the CodeIgniter database config is the following ['pconnect'] TRUE/FALSE
I am using MySQL on wamp server. It takes 0.6 secs to establish a
I'm painfully new to PHP, and was trying to set up phpBB on my
This is the PHP code given <?php $aColumns = array( 'engine', 'browser', 'platform', 'version',
We are seeing a MySQL connection problem on our server. The strange thing is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.