Jump to content

getimagesize warning......


2DaysAway

Recommended Posts

Warning: getimagesize(Array) [function.getimagesize]: failed to open stream: No such file or directory in...

 

The image is uploading fine in the DB and is displaying properly on the web page. So why would I get this error? This code has worked in the past. Only recently has this been happening.

 

Any ideas???

 

if ($fileupload)
{
        $arr_allow_ex=array("gif","jpg","png");
	$uploadpath=$dir."/";
	$source=$_FILES[fileupload][tmp_name];
	$fileupload_name=$_FILES[fileupload][name];
	$weight=$_FILES[fileupload][size];

        $imagehw = GetImageSize($fileupload);
        $imagewidth = $imagehw[0];
        $imageheight = $imagehw[1];
        
        if (($crew["founder"] != $user["pimp"]) && ($crew["cofounder"] != $user["pimp"])) { $message='you are not the founder of this crew.'; }
    elseif ($imagewidth >= 33){$message="image width to big ($imagewidth pixels)";}
    elseif ($imageheight >= 33){$message="image height to big ($imageheight pixels)";}
    else{

	for($i=0;$i<count($arr_allow_ex);$i++)
	{
		if(getlast($fileupload_name)!=$arr_allow_ex[$i])
			$test.="~~";
	}
	$exp=explode("~~",$test);

            if(strstr($fileupload_name, " ")) {$message='you cannot have spaces in file name.';}
	elseif(count($exp)==(count($arr_allow_ex)+1)){$message='invalid image type.';}
	elseif($weight>$wei_fileupload){$message="File is to large (".$wei_fileupload." bytes)";}
        else{
            $fileupload_name="$fileupload_name$time";
	    $dest = ''; 
	    if ( ($source != 'none') && ($source != '' ))
	    {
	    $dest=$uploadpath.$fileupload_name;
	    if ($dest != '')
	    {
        if (copy($source,$dest))
		   {
               $exfile=explode(".",$fileupload_name);
		   $message="icon has been set successfully!";
               mysql_query("UPDATE `{$tab[crew]}` SET `icon`='$dir$fileupload_name' WHERE `name`='$crw' AND rid='$rid'");
		   }
            }
         }
      }
   }
}

Link to comment
https://forums.phpfreaks.com/topic/132803-getimagesize-warning/
Share on other sites

.........Still getting the same warning and the file uploads. The $fileupload is the name of my input box

<input type="file" class="text" name="fileupload">

 

 

Ok, I just realized that my host has changed the version of php they are using. It was PHP/4.3.9 , now it's PHP/4.4.7. Would this cause the issue?

If so, any suggestions on how to fix the code and/or ask my server tech a specific question?

Link to comment
https://forums.phpfreaks.com/topic/132803-getimagesize-warning/#findComment-690670
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.