2DaysAway Posted November 15, 2008 Share Posted November 15, 2008 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'"); } } } } } } Quote Link to comment Share on other sites More sharing options...
kayess2004 Posted November 15, 2008 Share Posted November 15, 2008 Hi, I think this line : $imagehw = GetImageSize($fileupload); should be $imagehw = GetImageSize($fileupload_name); but I'm not 100% sure where $fileupload comes from.. HTH Quote Link to comment Share on other sites More sharing options...
2DaysAway Posted November 15, 2008 Author Share Posted November 15, 2008 .........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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.