2015-10-04 63 views
0

没有这样的文件或目录错误是在第27行“getimagesize”功能,我上传图像在相同的“路径“但是当我用行动继续进行,我得到这个错误每次和文件夹的路径,其中的图像是好的警告:getimagesize(upload/18.jpg)[function.getimagesize]:未能打开流:

PHP //连接到数据库

$link = mysql_connect("localhost" , "333" , "3333") 
    or die("could not connect " . mysql_error()); 
mysql_select_db("moviesite" , $link) 
    or die (mysql_error()); 

// make variables available 
$id = $_REQUEST['id']; 
if (isset($_REQUEST['mode'])) 
{ 
    $move = $_REQUEST['mode']; 
} 
else 
{ 
    $mode = '' ; 
} 

    // get info on the pic we want 
$getpic = mysql_query("SELECT * FROM images WHERE image_id = '$id' ") 
      or die(mysql_error()) ; 
     $rows = mysql_fetch_array($getpic); 
     extract($rows); 
    $image_filename = "upload/" . $image_id . ".jpg" ; 

    list($width, $height, $type, $attr) = getimagesize($image_filename); 

+0

可以请你添加和getimagesize功能? – 2015-10-04 20:24:26

+0

检查文件权限,它可能无法被所有人访问。尝试将其设置为755或777 –

回答

0

先试,以检查文件是否存在:

if (!file_exists($image_filename)){ 
    echo "file not found!"; 
    exit; 
} 
相关问题