Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
PHP File Handling?
I know nothing about PHP or It's syntax, but I need a little bit of code written for me as I'm incapable of writing it myself...
It seems very simple and I'm not sure how I haven't solved my question via google but oh well...
I need a PHP file that gets a URL from a HTML text box (The user inserts a download link) then when pressing a button it downloads this file naming it as a .docx (but not converting it.) This will allow me to download exe's in school because .docx is a legal MIME type on our network.
Any help would be widely appreciated? Thanks! :)
2 Answers
- Robert JLv 77 years ago
It won't work.
The file name is whatever it is on the remote system, and that is the file that would be requested by the PHP code.
It could be saved to disc in a different name, but the external download request would be the exact same URL and file name / type as your URL form entry.
You would have to first save the files with a changed extension on an external server to request them - and then the download would work in the same way from any other machine or browser.
There is no guarantee anything other than a .docx file would be passed intact, as content filtering would detect a binary file rather than a text / xml file.
- Anonymous7 years ago
PHP is a kind of server language, it only need to put in the server executable, can directly use notepad to open.