I have been working on this download script for quite a while, and I just can't find how to download a remote file via a user's browser using fsockopen.
Basically I am wondering if anyone can just give me a simple working example on how to use fsockopen() to fetch a file on a remote server, and then pop up a save dialog box in my browser. For example, let's say I want to download this file from here:
Code: Select all
http://remotedomain.com/file.zipCode: Select all
http://localhost/index.php?url=http://r ... m/file.zipI don't need a whole hand-made script, I just need the part where fsockopen will download this file. Perhaps a working function that would do it. Please try not to use classes or objects because I haven't quite figured out object-oriented programming yet!!
Also, I would like if you can do it via HTTP 1.0 because I know HTTP 1.1 is tricky, and might require a chunk decoder.
Thanks to anyone who can help.