Matthias Vill <theconstructor <at> web.de> writes:

> 
> Hi Karthik,
> 
> > 
> > Is there any way to find the file name of the downloaded file?
> > 
> 
> Of course there is. Normally wget will transform the last segement of
> the url into the filename by changing characters not supported by you
> filesystem to similar charakters like "?" ist stored as "%3F" wich is
> the URL-Escape sequence.
> If you happen to download the output of a cgi-script the headers of the
> http-response sometimes contain a line like >>Content-Disposition:
> attachment; filename="downloaded.pdf"<< which indicates that wget should
> save the contents to downloaded.pdf.
> 
> The name really used is on last wget-line.
> 
> I guess you're in scripting and i would suggest you append an -O-Option
> like "wget -O local/file http://server/url"; as long as you download one
> file at a time this just tells wget to save the file as "local/file"
> instead of "url", which makes it perfectly predictable.
> 
> Hope that helps
> 
> Matthias
> 
> 

Hello Matthias,

 Thanks for your reply. i checked the log file, and i saw that it has
content-Disposition=attachment;filename=test.pdf. So what you suggest is to
download the file with some name and read the log file and then get the file
name and rename the local file right?

isn't there any other direct way to do this? of course i use System() to all the
WGET in my PERL script

Best regards,
Karthik




Reply via email to