Home > Backend Development > PHP Tutorial > !readfile下载本地服务器测试没有关问题,可是上传到空间服务器就是无法识别文件大小

!readfile下载本地服务器测试没有关问题,可是上传到空间服务器就是无法识别文件大小

WBOY
Release: 2016-06-13 12:27:27
Original
757 people have browsed it

求助!readfile下载本地服务器测试没问题,可是上传到空间服务器就是无法识别文件大小
求助!readfile下载本地服务器测试没问题,可是上传到空间服务器就是无法识别文件大小,本人新手,还望高手指点一二!

<br /><? include_once("common/conn.php")?><br /><?<br />$sql="select * from lxy_download";<br />$result=mysql_query($sql);<br />while($row=mysql_fetch_assoc($result)){<br />	{<br />		?><br /><?<br />$file_name = "$FileFile"; <br />$file_dir = "system32/upload/Download/";<br />$filesize=filesize("$file_dir/$file_name");  <br />    Header ( 'Content-type: application/octet-stream');  <br />    Header ( 'Content-Ranges: bytes');  <br />    Header ( 'Content-Length:'.$filesize);  <br />    Header ( 'Content-Disposition: attachment; filename='. $file_name );  <br />	ob_end_clean(); <br />	flush();  <br />    readfile("$file_dir/$file_name") ;<br />	exit(0);<br />}<br />?><br /><?<br />}<br />?><br />
Copy after login

------解决思路----------------------
$FileFile?这个$FileFile是get或者post来的吧
大部分服务器是没开启把request参数自动转换成变量的
乖乖用$_GET['FileFile']或者$_POST['FileFile']试一下

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template