I am writing a python script that downloads a file given by a URL. Unfortuneatly the URL is in the form of a PHP script i.e. www.website.com/generatefilename.php?file=5233
If you visit the link in a browser, you are prompted to download the actual file and extension. I need to send this link to the downloader, but I can't send the downloader the PHP link.
How would I get the full file name in a usable variable?
What you need to do is examine the Content-Disposition header sent by the PHP script. it will look something like:
Content-Disposition: attachment; filename=theFilenameYouWant
As to how you actually examine that header it depends on the python code you're currently using to fetch the URL. If you post some code I'll be able to give a more detailed answer.
I want the actual file name that is returned by a PHP script