Link to home
Start Free TrialLog in
Avatar of AVCProgrammer
AVCProgrammer

asked on

Internet File PROBLEM

Hi,

I have a very big problem with an FTP file.
I'm programming a FTP Client for updating  and dowloading files from internet via FTP.
I try to do a ResumeUpdate function that allow users to break an upload and to resuming later.

When I try to seek my Internet file (already opened for writing), the CInternetFile class throws an exception.
I read Microsoft documentation and I see that seek is allow only for the CHttpFile class.

My question is:
there is a way to buypass this exception, that is there is a way to seek an opened for writing internet file????
Avatar of jkr
jkr
Flag of Germany image

You should be able to do that by using 'CInternetFile::Seek
':

pIF->Seek ( lSizeOfDownloadedFileOnDisk, CFile::begin);

Avatar of AVCProgrammer
AVCProgrammer

ASKER

To jkr

I'm uploading and not downloading a file. If yuo read the seek help on CInternetFIle, you will see that seek is allowed only for ChttpFile.

Thanks for your answer
Try with a "InternetSetFilePointer". It's a Win32 function (WININET.DLL).
To icqd

Also teh InternetSetFilePointer has a big problem. You can call it only with file opened in read mode.

Thanks !
>>to break an upload and to resuming later.

Well, I thought you wanted to resume a download. AFAIK, resuming uploads is not supported by the protocol...
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to refund the points and PAQ at zero points since nobody had a satisfying answer for you.

The link to the Community Support area is: https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial