我正在尝试使用 BLOB 创建多个上传。
上面的代码给了我以下错误
警告:fopen(C:\xampp\tmp\php4FC4.tmp):打开流失败:没有这样的文件或目录
PHP 脚本
$jumlah_file = count($_FILES['userfile']['name']);
$path = pathinfo($_SERVER['PHP_SELF']);
for ($i = 0; $i < $jumlah_file; $i++)
{
$tmp_file = $_FILES['userfile']['tmp_name'][$i];
$filetype = $_FILES['userfile']['type'][$i];
$filesize = $_FILES['userfile']['size'][$i];
$filename = $_FILES['userfile']['name'][$i];
$destination = $path['dirname'].
'/data/'.$filename;
move_uploaded_file($tmp_file, $_SERVER['DOCUMENT_ROOT'].$destination);
}
$fp = fopen($tmp_file, 'r'); // ERROR LINE
$content = fread($fp, filesize($tmp_file));
$content = addslashes($content);
fclose($fp);
if (!get_magic_quotes_gpc())
{
$fileName = addslashes($filename);
}
$query = mysql_query("INSERT INTO `konveksi`.`foto` (`id_foto`, `id_daftar`, `id_pesanan`, `foto`) VALUES (NULL, '15', '1','$content');");
mysql_query($query) or die('Error, query failed');
我必须做什么?如果这是一个愚蠢的问题,请原谅,我对 PHP 很陌生。