473,795 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing filename makes getimagesize work...?

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?

May 21 '07 #1
4 2593
At Mon, 21 May 2007 15:27:18 -0700, Acrobatic let his monkeys type:
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.
May 21 '07 #2
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...@invali d.spam>
wrote:
At Mon, 21 May 2007 15:27:18 -0700, Acrobatic let his monkeys type:
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.

May 21 '07 #3
Acrobatic wrote:
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_f ile() to get it into a "working" directory.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
May 22 '07 #4
On May 21, 7:20 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
>
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_f ile() 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

May 22 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
2706
by: Bo Peng | last post by:
Dear list, I have many dictionaries with the same set of keys and I would like to write a function to calculate something based on these values. For example, I have a = {'x':1, 'y':2} b = {'x':3, 'y':3} def fun(dict):
4
2547
by: Pokerkook | last post by:
Hello, If anybody could help me with this I would greatly appreciate it. Or at least tell me why I get the output of this garbage: 49 49 10 49 52
1
9248
by: sree | last post by:
Hi, am new bie to this group. I requesting help from you all. Am geeting warnig with getimagesize() function. I will explain my query by first giving my code. $src = $_GET; $imageInfo = getimagesize($src);
1
1643
by: lawrence k | last post by:
I've got an intermittent bug that is very hard to trace. On my site, if I log into a new account and try to upload some images, something goes wrong the first time. Everything works fine after the first time, but the first time getimagesize fails to return a type, which is blank in the following error messge. I'm going to check for weird path issues that might be related to first login, but is anyone aware of situations where getimagesize ...
1
5202
by: Karl Groves | last post by:
I am working on a personal project and having trouble with getimagesize() I have an URL to a file I *know* for a fact exists. The url in question is pulling longblob data from the database. This has never been a problem for me before. Moreover, in the past, this has worked for other similar scripts. getimagesize works on every image file I have thrown at it, except these which are coming from the database.
2
3535
by: bizt | last post by:
Hi, Is it possible to obtain the width/ height of an image when that image is dyanically created using a PHP script and passing GET attributes. For example: <img src="images/showImage.php?image_id=5" /> My images are created from images stored on the server, their paths stored on in database table and retrieved using the GET image_id and
6
17582
by: bluesky9394 | last post by:
I encounter the following error. Warning: getimagesize(WebRoot/common/images/profile/) : failed to open stream: Permission denied in C:\Data\PHPSites\kamwo\indextmp-new.php on line 296 but it's working fine on my another php script. php code: $path = "WebRoot/common/images/profile/"; $file = $row1;
1
4885
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop program,which can upload many file in folder.problem is,am unable to save my file name in to database.because i used same name for all input file type as file. i dont know get name of file.below i presented my coding for ur view.fed up with my coding..pls...
0
2218
by: RobUK | last post by:
We have Apache on the local network managing several websites that are accessed using virtual domains (configured in the local machine's hosts file, eg. 192.168.1.10 points to dev.somedomain.com). I am reworking the way that I access images on the site by specifying the http://etc address of the image instead of the local relative address. This is so that I can eventually have a separate server serving images to all websites (a lot of images...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.