2DaysAway Posted December 11, 2008 Share Posted December 11, 2008 Error: Warning: getimagesize(HighRollerz.gif) [function.getimagesize]: failed to open stream: No such file or directory in /home/thumpi5/public_html/crew.php on line 111 Here is the script: 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_name); $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'"); } } } } } } Now, its uploading the file to the database. It worked fine in Php4 but now that its in php5, I'm getting this error, any ideas or help would be appreciated, thank you. Quote Link to comment https://forums.phpfreaks.com/topic/136545-solved-failed-to-open-stream-no-such-file-or-directory-error/ Share on other sites More sharing options...
Mark Baker Posted December 11, 2008 Share Posted December 11, 2008 $imagehw = GetImageSize($source); Quote Link to comment https://forums.phpfreaks.com/topic/136545-solved-failed-to-open-stream-no-such-file-or-directory-error/#findComment-712764 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.