cURL / Mailing Lists / curl-users / Single Mail

curl-users

Store file troubleshoot with CURL [Serious Issue]

From: xNokia <xnokia_at_gmail.com>
Date: Tue, 1 Mar 2011 03:30:34 +0300

Hi All,
There are an issue with curl when it comes to there are no filename in the
URL and no file name on the header as it on megaupload website, if I tried
to download a file from this URL
http://www.megaupload.com?d=JLMHQ16K by using the command below
curl -OLJg --cookie /home/AG/cookies/rapidshare2 -w
",%{url_effective},%{size_download},%{content_type}\n"
http://www.megaupload.com/?d=JLMHQ16K
The stored filename will be ?d=JLMHQ16K, while it should be crashreport.exe,
I tried to edit the curl source code to let it to capture the file name from
the latest followed location instead of the initial URL but it doesn't work
as I want as it always give coredumped error, I wonder if there anyway to
sort the issue by having the CURL to capture the filename from the latest
followed location if there are no filename in the header.

Part of the edits I made:-
First shot:
          if(!outfile) {

/* NOHEADER FILENAME */
    // outfile = get_url_file_name(url);

 outfile = "NOHE";

Second shot:

if ("NOHE" == outs.filename) {

             char *this_url=NULL;
             curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &this_url);

 // /* extract the file name from the URL */
 outs.filename = get_url_file_name(this_url);

 }

Thanks for taking the time to read this email and I will be looking forward
for a reply as I'm working on a project which need this function to be
sorted.
X

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-01