$id=mysql_insert_id();
// 读取数据
$query="select * from binary_data where id='$id'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$data = base64_decode($row[picture]);
$type = @MYSQL_RESULT($result,0, "uptypes");
// 显示文件
header("Content-type:$type");//出现错误?????
echo $data;
echo "This file has the following Database ID: $id";
===================================================
这是那里的问题啊,下面是错误信息Warning: Cannot modify header information - headers already sent by (output started at D:\website\network\admin\upload.php:38) in D:\website\network\admin\upload.php on line 48
// 读取数据
$query="select * from binary_data where id='$id'";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$data = base64_decode($row[picture]);
$type = @MYSQL_RESULT($result,0, "uptypes");
// 显示文件
header("Content-type:$type");//出现错误?????
echo $data;
echo "This file has the following Database ID: $id";
===================================================
这是那里的问题啊,下面是错误信息Warning: Cannot modify header information - headers already sent by (output started at D:\website\network\admin\upload.php:38) in D:\website\network\admin\upload.php on line 48
看看你前面有没有echo 之类的,
关于第1个错误:
$ufile = $HTTP_POST_VARS["upfile"];
$data =addslashes(fread(fopen($ufile, "r"), filesize($ufile)));
表面上看是$ufile所指出的文件不存在,而根据$HTTP_POST_VARS["upfile"]的表述,你应该是在做上传文件并入库的操作。
打开上传的文件时,文件名应取自$HTTP_POST_FIELDS['upfile']['tmp']
$HTTP_POST_FIELDS['upfile']['tmp']
===》
$HTTP_POST_FILES['upfile']['tmp']