Connecting Tech Pros Worldwide Forums | Help | Site Map

Changing filename makes getimagesize work...?

Acrobatic
Guest
 
Posts: n/a
#1: May 21 '07
I'm having troubles uploading an image and getting data from
getimagesize().

When I upload a file with the name "20050914_loRes_XLH1.jpg", and do a
getimagesize on it, it returns no info (null and empty). However, if I
change the filename to something like "camera.jpg" and upload it,
getimagesize() works perfectly, and I can print_r the array of data.

PHP is uploading the files to my /var/temp directory just fine. Also,
I have all errors turned on, and nothing looks out of place. Any ideas
why changing the file name would let this work?


Schraalhans Keukenmeester
Guest
 
Posts: n/a
#2: May 22 '07

re: Changing filename makes getimagesize work...?


At Mon, 21 May 2007 15:27:18 -0700, Acrobatic let his monkeys type:
Quote:
I'm having troubles uploading an image and getting data from
getimagesize().
>
When I upload a file with the name "20050914_loRes_XLH1.jpg", and do a
getimagesize on it, it returns no info (null and empty). However, if I
change the filename to something like "camera.jpg" and upload it,
getimagesize() works perfectly, and I can print_r the array of data.
>
PHP is uploading the files to my /var/temp directory just fine. Also,
I have all errors turned on, and nothing looks out of place. Any ideas
why changing the file name would let this work?
Are you sure there are no spaces in the original filename? The user notes
in the manual mention issues with spaces in filenames used with
getimagesize(). Perhaps one of the other chars in your filename has the
same effect?

Sh.
Acrobatic
Guest
 
Posts: n/a
#3: May 22 '07

re: Changing filename makes getimagesize work...?


I considered that but it renames it to the unix filename in my var/
temp directory, something like PHPv5jalL. So, I don't think any spaces
or invalid characters are messing me up there because PHP renames it
for me.

On May 21, 5:56 pm, Schraalhans Keukenmeester <inva...@invalid.spam>
wrote:
Quote:
At Mon, 21 May 2007 15:27:18 -0700, Acrobatic let his monkeys type:
>
Quote:
I'm having troubles uploading an image and getting data from
getimagesize().
>
Quote:
When I upload a file with the name "20050914_loRes_XLH1.jpg", and do a
getimagesize on it, it returns no info (null and empty). However, if I
change the filename to something like "camera.jpg" and upload it,
getimagesize() works perfectly, and I can print_r the array of data.
>
Quote:
PHP is uploading the files to my /var/temp directory just fine. Also,
I have all errors turned on, and nothing looks out of place. Any ideas
why changing the file name would let this work?
>
Are you sure there are no spaces in the original filename? The user notes
in the manual mention issues with spaces in filenames used with
getimagesize(). Perhaps one of the other chars in your filename has the
same effect?
>
Sh.



Jerry Stuckle
Guest
 
Posts: n/a
#4: May 22 '07

re: Changing filename makes getimagesize work...?


Acrobatic wrote:
Quote:
I'm having troubles uploading an image and getting data from
getimagesize().
>
When I upload a file with the name "20050914_loRes_XLH1.jpg", and do a
getimagesize on it, it returns no info (null and empty). However, if I
change the filename to something like "camera.jpg" and upload it,
getimagesize() works perfectly, and I can print_r the array of data.
>
PHP is uploading the files to my /var/temp directory just fine. Also,
I have all errors turned on, and nothing looks out of place. Any ideas
why changing the file name would let this work?
>
I've had problems in the past with working on uploaded files in the /tmp
directory. I've had much better success with them after calling
move_uploaded_file() to get it into a "working" directory.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Acrobatic
Guest
 
Posts: n/a
#5: May 22 '07

re: Changing filename makes getimagesize work...?


On May 21, 7:20 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>
I've had problems in the past with working on uploaded files in the /tmp
directory. I've had much better success with them after calling
move_uploaded_file() to get it into a "working" directory.
That did the trick, thank you for the suggestion. I moved it to
another folder before doing getimagesize() on it...

Thanks again
J

Closed Thread