Warning: getimagesize: Unable to open '' for reading ...
Posted: Wed Oct 29, 2003 11:54 am
Hey again everyone.
Ok, I am getting this error message when I try to work with an uploaded file:
The HTML that has the form seems correct. It is as follows:
Pretty straight forward. Then, the PHP code that processes this is here (I took this from another post and slightly modified it):
Line 744 is the last line there, $imgsize = GetImageSize($filetemp);. When I try to print out the contents of $filename, $filesize, $filetype, or $filetemp, it's all blank.
Do I need any special permissions set somewhere?
I read from other posts that there may be a limitation in file size on uploading, but I tried this with a file that is less than 100 bytes and it still didn't work.
Your help is appreciated!
Thanks,
Peter.
Ok, I am getting this error message when I try to work with an uploaded file:
Code: Select all
Warning: getimagesize: Unable to open '' for reading. in /home/httpdocs/frames/profile.php on line 744Code: Select all
<FORM ACTION="profile.php" METHOD="post">
<INPUT TYPE="file" NAME="photo" SIZE="50" ACCEPT="image/jpeg">
<INPUT TYPE="submit" VALUE="Upload Photo" CLASS="button">
</FORM>Code: Select all
<?php
$filetype = $_FILES["photo"]["type"];
$filesize = $_FILES["photo"]["size"];
$filename = $_FILES["photo"]["name"];
$filetemp = $_FILES["photo"]["tmp_name"];
$maxwidth = 400;
$maxheight = 500;
$savedir = "/home/httpdocs/images/user";
$newfilename = rand(1111111111, 9999999999);
$newfilename = date("md") . $newfilename;
$imgsize = GetImageSize($filetemp);
...
?>Do I need any special permissions set somewhere?
I read from other posts that there may be a limitation in file size on uploading, but I tried this with a file that is less than 100 bytes and it still didn't work.
Your help is appreciated!
Thanks,
Peter.