File Upload Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
unscathed
Forum Newbie
Posts: 2
Joined: Thu Sep 22, 2005 4:47 am
Contact:

File Upload Problem

Post by unscathed »

Hi All! I need to upload image files to our server. I used the sample code from http://www.php.net/features.file-upload. When I tested the script, I was able to upload the .gif file in the /tmp folder and was able to move it to the directory that I specified. The problem is when I tried viewing the uploaded image, it wasn't complete! (Sometimes, only half of the image appears and sometimes, it doesn't even display anything!) Also, the file size of my original image is different from the one that I uploaded. What could be causing this? Do I need to fix some configuration files?

Any help would be appreciated. Thanks in advance! ^_^
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yar, welcome to the boards. I be feyd the (mostly) friendly pi-rate (on Thursdays) moderator... yar.

Your host may be clearing the /tmp folder on a frequent basis. Since you will likely not be allowed to change the location uploaded files are saved to, ye might want to talk to yar host... yar.
unscathed
Forum Newbie
Posts: 2
Joined: Thu Sep 22, 2005 4:47 am
Contact:

/tmp folder

Post by unscathed »

hmmm. after uploading, i use the function move_uploaded_file and then when i check the image file, it's corrupted. any suggestions? i already did everything that the user notes suggested (check upload_max_filesize and post_max_size, even added the entry that sets the LimitRequestBody in httpd.conf and restarted apache) but it still wouldn't work. has anyone encountered this problem?

thanks feyd and again, thanks in advance. ^_^
Post Reply