php: force download from different domains? -


I wonder if you come up with some terrible solutions for my problem. Not working normally!

OK, I'm trying to force-download a file on any website with the following php script. Do I just pass? P = and the download prompts for my url

  & lt ;? Php error_reporting (E_ALL); If (isset ($ _GET ['p'])) $ path = $ _GET ['p']; Second "No Way Set!" Echo; $ File = $ path; // header ('location:'. $ File); // works perfectly, the browser opens the file in // title ("cache-control: no-cache"); Header ("End: -1"); Header ("content-type: application / octet-stream;"); Header ("Content-Attention: Attachment; File Name = \" ". BaseName ($ file)." \ ";"); Header ("content-transfer-encoding: binary"); Header ("content-length:". Filesystem ($ file)); Echo readfile ($ file); ? & Gt; However, as I have found today (filesize) does not work with local files on my server just with an HTTP request it also applies to readfile ()  

WARNING: FilesEzek () [function.filesize]: Path pathfile failed ... / Downloader / d.php on line 15

WARNING: Readfile (sphotos.ak .fbcdn.net / hphotos-ak-snc4 / hs211.snc4 / ...) [function.readfile]: failed to open stream: HTTP request failed! HTTP / 1.0 403 is forbidden in the passphrase ... / downloader / dppp On line 16

I wonder if there are creative coders who can help me here Do I have a chance to do this script work? I just want to download any file and url forcibly.

thanks, thanks in advance, matte

filesize ( ) and readfile () can work with some protocols if your PHP settings allow.

More original, though:

HTTP request failed! HTTP / 1.0 403 is prohibited in pathophiles ....

Remember that when using a PHP using a file, not the user's login The permissions are available. The script instaince is working like an independent browser. If a resource is password-protected, you need to first create your PHP script log.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -