Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hi,

i am working under windows environment.

i try to open the file in following manner. but file handle gives null values

code:

C++
FILE * fp = fopen("http://SomeIp//filename.txt", "r");


it gives null values.

can you suggest any other way to read the file using http..
Posted
Updated 29-May-12 20:03pm
v2

try this code from MS:

http://support.microsoft.com/kb/149413[^]
 
Share this answer
 
v4
You can use fopen() to open local files, or remote (nfs) mounted file only, but not a http content, To get http content, you need to make a TCP connection to http server("SomeIp"), and than write a http request on that connection, than http server will reply back with desired content.
To implement this you can use boost(C++) or libcurl(C). Good Luck
 
Share this answer
 
Whenever I want to GET an HTTP entity I reach for libcurl[^]. It'll do read only sequential access of the type you seem to be after.
 
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