http error codes

32 views
Skip to first unread message

Deepak Adhikari

unread,
Apr 30, 2013, 1:58:52 PM4/30/13
to cur...@googlegroups.com
i want to download a file using http
the attached code works fine.

but the code is not usable when
-> the file is missing in the server
-> or if proper permission is not given to access the file
even if the file is missing or with no proper permission...the error code says CURL_OK ie no error.
the file still gets downloaded, and in it there is html page of apache 404 error or 403 error

i googled for many times but could not come up with any solutions
anyone could could please help me with these queries
-> how to stop redirect?
-> how to first check the http status codes? and if its 200 then only download file or else display proper message to user?
-> what are the basics test i need to perform before and after downloading of file? (so that the file gets downloaded successfully)


could anyone please help me
with regards,
deepak
curl0.cpp
Reply all
Reply to author
Forward
0 new messages