curl-users
Re: Store file troubleshoot with CURL [Serious Issue]
Date: Tue, 8 Mar 2011 20:57:46 +0300
Hi Daniel,
Thank you very much for answer, much appreciated.
I hope if you kindly let me know where I can find the documented part you mentioned and also if you could let me know when you are planing to make curl able to handle a situation like this. I wonder if there a private service where I can pay for that to be made on the way I want, because I will be using it on a project. I'm not a c or c++ expert to know how I can me diff/patch to curl.
Thank you again Daniel and I will looking for you response soon.
Sent from my iPad
On Mar 8, 2011, at 2:02 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Tue, 1 Mar 2011, xNokia wrote:
>
>> 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,
>
> By definition it actually should not as curl quite clearly is documented how it will act in this case.
>
>> 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
>
> I wouldn't accept that anyway as unconditional behavior as it would break how existing scripts work. I'm willing to consider a new option for this though that would work similar like -J then I guess, altering which name to ultimately use for the URL.
>
>> 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.
>
> You can easily make a script that first uses a random name with -o, then you download -w and %{url_effective} to extract the "last" URL and then you get the file name part off that and rename $random to $file.
>
>> Part of the edits I made:-
>
> If you want to push for such a change you need to provide a full diff/patch.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> 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
-------------------------------------------------------------------
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-08