Hallo,
ich möchte vom meinem Download Server eine datei laden, das mache ich so:
<?php
$loc = $_GET['loc'];
$data = $_GET['file'];
function download($file , $name) {
$size = filesize($file);
header("Content-type: application/octet-stream"
header("Content-disposition: attachment; filename=".$name);
header("Content-Length: ".$size);
header("Pragma: no-cache"
header("Expires: 0"
readfile($file);
}
download("$loc/$data" ,"$data"
?>
Link:
load.php?file=test.gif&loc=http://www.********.de/files/download/wallpaper
Nur leider kommt dan immer der fehler, mache ich es auf meinem eigenem Server kommt kein fehler:
Warning: stat failed for http://www.********.de/files/download/wallpaper/1 (errno=2 - No such file or directory) in C:\FoxServ\www\Re-Design\load.php on line 5
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\Re-Design\load.php:5) in C:\FoxServ\www\Re-Design\load.php on line 6
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\Re-Design\load.php:5) in C:\FoxServ\www\Re-Design\load.php on line 7
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\Re-Design\load.php:5) in C:\FoxServ\www\Re-Design\load.php on line 8
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\Re-Design\load.php:5) in C:\FoxServ\www\Re-Design\load.php on line 9
Warning: Cannot add header information - headers already sent by (output started at C:\FoxServ\www\Re-Design\load.php:5) in C:\FoxServ\www\Re-Design\load.php on line 10
Warning: php_network_getaddresses: gethostbyname failed in C:\FoxServ\www\Re-Design\load.php on line 11
Warning: readfile("http://www.********.de/files/download/wallpaper/1" - No such file or directory in C:\FoxServ\www\Re-Design\load.php on line 11
Mfg. BNS