Tôi có thể sử dụng URL bên ngoài trong tệp readfile() không?PHP readfile() của URL bên ngoài
header('Content-type: application/pdf');
header('Content-Transfer-Encoding: binary');
header('Content-Disposition: inline; filename="'.$file.'" ');
//header('Content-Length: ' . filesize("http:...z/pub/".$file.'.pdf'));
@readfile("http://...z/pub/".$file.'.pdf');
Dùng thử và/hoặc [RTM] (http://php.net/readfile): "URL có thể được sử dụng làm tên tệp với chức năng này nếu trình bao bọc fopen đã được bật". ;-) – netcoder
Tôi có nên làm 'exec (' wget $ url -O $ filename ") 'không? – user583311