Click to See Complete Forum and Search --> : Can't get image size


thesquirrel16
06-21-2007, 03:09 PM
Hi i am running off of a windows NT server. I cannot get some of my code to work properly. I am trying to resize pictures as they are uploaded.

This is the line that does not work for me:

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

the variables show to be empty, and file is the name of the open text box. Am I doing something wrong here? The error thrown is:
Warning: getimagesize(IMG_1543.jpg) [function.getimagesize]: failed to create stream: No such file or directory in c:\websites\jgcustomhomes71\jgcustomhomes.com\new\picupload.php on line 94

Also this line is not working
$thepicture = getimagesize("$add"); where $add is the image copied over to the server from $file, $thepicture comes up blank

Kyleva2204
06-21-2007, 03:14 PM
Well it looks like that the variable $file_name points to.. well nothing. Try something like "./$file_name"... Maybe that would work. I personally don't know. Or try giving the full url of the file. such as c:\websites\jgcustomhomes71\jgcustomhomes.com\new\$file_name

hope this helps.

thesquirrel16
06-21-2007, 04:31 PM
I'll try it out, do you know if this function has to point to the file on the server, or can it be on the persons computer?

thesquirrel16
06-21-2007, 04:32 PM
haha ok I am an idiot. I was pointing to the address on the computer and not the server... problem solved =p thanks!

Kyleva2204
06-21-2007, 04:44 PM
:) no prb.