Click here to Skip to main content
15,881,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to read the file using the URL?Using URLDownloadToFile. Want to read the file and saving it in a variable instead of saving the file in hard disk?
Posted
Comments
Sandeep Mewara 24-May-11 1:41am    
Any effort?
Gokulnath007 24-May-11 1:57am    
I have used URLDownloadToFile and downloaded the file to hard disk, but i just want to read the contents of the file instead of saving to the system.

In a overlapped operation:

Call WSASend[^] with lpBuffers point to the file you want to download, for example:

WSABUF sendBuf;
sendBuf.buf = "GET /index.html HTTP/1.1\r\n\r\n";
sendBuf.len = strlen( sendBuf.buf );

WSASend( sock, &sendBuf, 1, &dwBytes, 0, &recvOv, SendComplete );


And process the buffer in your lpCompletionRoutine callback
WSARecv[^]
 
Share this answer
 
Hi Gokulnath,

As per your comments one way is
1) Read the file that you download in a buffer and than delete it.
and
2) I am not sure about this but I found one API

InternetReadFile ->[^]

Example ->[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900