• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • Last Modified:

How can i use putfile fn properly?

hi !

   I have used 'PutFile' fn to upload a file.But if the fn fails how will i know the exact cause of failure?I used GetLastError(),but i don't know what error the value points to.

Is there any other method?
can anyone help?

Thanks in advance
ceena.
0
ceena
Asked:
ceena
1 Solution
 
abdijCommented:
Hi,
What is the error code u get after GetLastError()??

Bye
Abdij
0
 
mahnoCommented:
U can find Error Codes description in MSDN
0
 
ceenaAuthor Commented:
Thanks. it is 120131.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ceenaAuthor Commented:
Thanks. it is 120131.

0
 
mikeblasCommented:
You're giving us the wrong error number; 120131 is not a valid Windows error number.

many errors from WinINet functions are in the range 12000 to 12500 or so.  12130 thru 12138 are errors specific to the GOPHER protocol. FTP errors area 12110 thru 12112.

12031 is ERROR_INTERNET_CONNECTION_RESET, which means the server abruptly reset the connection with your app.

Please give us the correct error number, or maybe show some code. Otherwise, we can't give you much advice.

..B ekiM
0
 
ceenaAuthor Commented:
really sorry abt it. it is 12031 .thanks for the info.
0
 
ceenaAuthor Commented:
Adjusted points from 50 to 100
0
 
ceenaAuthor Commented:

  How can i know how much % of file has been transferred......i want to introduce a progress bar
for the file transfer....so how will i know the file transfer rate....How can i use onstatus call back fn properly.....
0
 
mikeblasCommented:
To make a progress bar, you can't use PutFile().  You'll need to open the file locally, open the file remotely, measure the size, and transfer block by block. Your progress will be given by the number of blocks trnasferred relative to the file size.

..B ekiM
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now