473,240 Members | 1,452 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

Trouble uploading images

Hi, I'm using PHP 4 and I am submitting some images in a form with

<form name=addProductForm enctype="multipart/form-data" method=post
action="add_product_response.php">
<input type=file name='prodImg' id='prodImg'>

However, sometimes, the images fail to upload, even though the form
submits fine. When I try to print out the values from the
$_FILES['prodImg'] array, I get

name: ONDA076.jpg
type:
tmp_name:
error: 3
size: 0

What does an error code of 3 mean? I would prefer not to do anything
to my image (take it to PhotoShop and edit it, etc.). Is there
something else I can do so that it will upload?

Thanks, - Dave

Jul 17 '05 #1
4 2690
On 18 Dec 2004 12:43:47 -0800, la***********@zipmail.com wrote:
Hi, I'm using PHP 4 and I am submitting some images in a form with

<form name=addProductForm enctype="multipart/form-data" method=post
action="add_product_response.php">
<input type=file name='prodImg' id='prodImg'>

However, sometimes, the images fail to upload, even though the form
submits fine. When I try to print out the values from the
$_FILES['prodImg'] array, I get

name: ONDA076.jpg
type:
tmp_name:
error: 3
size: 0

What does an error code of 3 mean? I would prefer not to do anything
to my image (take it to PhotoShop and edit it, etc.). Is there
something else I can do so that it will upload?


http://uk2.php.net/manual/en/feature...oad.errors.php

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
la***********@zipmail.com wrote:
Hi, I'm using PHP 4 and I am submitting some images in a form with ..... However, sometimes, the images fail to upload, even though the form
submits fine. When I try to print out the values from the
$_FILES['prodImg'] array, I get

name: ONDA076.jpg
type:
tmp_name:
error: 3
size: 0

What does an error code of 3 mean? I would prefer not to do anything
to my image (take it to PhotoShop and edit it, etc.). Is there
something else I can do so that it will upload?


This suggests that the file is to large for your current configuration.

There are at least 2 config settings that is worth looking at:
upload_max_filesize
http://www.php.net/manual/en/ini.sec...d-max-filesize
This value can only be changed in php.ini, httpd.conf (asuming you're using
apache), or a .htaccess file.

The second setting is:
post_max_size
http://www.php.net/manual/en/ini.sec....post-max-size
This value can only be changed the same places as upload_max_filesize.

--
Tommy

Jul 17 '05 #3
Thanks for the advice. I don't have control over the php.ini file, but
I tried adding these settings

// set max file upload sizes
ini_set("upload_max_filesize", "10M");
ini_set("post_max_size", "12M");

This is well above what the size of the file I'm uploading. However, I
get the same result. Apache is the web server. I have a hunch the web
server is cutting me off. What would the .htaccess file look like
since I also don't have control over the httpd.conf file?

Thanks again, - Dave

Tommy Gildseth wrote:
la***********@zipmail.com wrote:
Hi, I'm using PHP 4 and I am submitting some images in a form with ....
However, sometimes, the images fail to upload, even though the form
submits fine. When I try to print out the values from the
$_FILES['prodImg'] array, I get

name: ONDA076.jpg
type:
tmp_name:
error: 3
size: 0

What does an error code of 3 mean? I would prefer not to do anything to my image (take it to PhotoShop and edit it, etc.). Is there
something else I can do so that it will upload?


This suggests that the file is to large for your current

configuration.
There are at least 2 config settings that is worth looking at:
upload_max_filesize
http://www.php.net/manual/en/ini.sec...d-max-filesize This value can only be changed in php.ini, httpd.conf (asuming you're using apache), or a .htaccess file.

The second setting is:
post_max_size
http://www.php.net/manual/en/ini.sec....post-max-size This value can only be changed the same places as upload_max_filesize.
--
Tommy


Jul 17 '05 #4
la***********@zipmail.com wrote:
Thanks for the advice. I don't have control over the php.ini file, but
I tried adding these settings

// set max file upload sizes
ini_set("upload_max_filesize", "10M");
ini_set("post_max_size", "12M");

No, as I said. you can't set these values using ini_set(), since they have
to be set, before the script is run.
This is well above what the size of the file I'm uploading. However, I
get the same result. Apache is the web server. I have a hunch the web
server is cutting me off. What would the .htaccess file look like
since I also don't have control over the httpd.conf file?


put this in your .htaccess file:
php_value post_max_size 22M
php_value upload_max_filesize 10M
This may or may not work, depending on the restrictions your webhost has set
in the httpd.conf file, with regards to what you may do in the .htaccess
file.

--
Tommy

Jul 17 '05 #5

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

Similar topics

7
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the...
1
by: psb | last post by:
WHO HAS THE BEST COMPONENT FOR FILE UPLOAD? HELP!? has anyone achieved 100% success with HTTP uploading with Mac clients??? I thought the whole <input type="file" .../> was a w3c standard that...
3
by: Gavin | last post by:
I need some help, I need the code to allow people that visit my website to be able to upload pictures to a file on my web server. I have been able to get close, but not quite there yet. Set fso...
2
by: laredotornado | last post by:
Hi, I'm using PHP 4 and trying to upload an image. I think I'm using the right "enctype". Here is the form I submit <form name=addPhotoForm enctype="multipart/form-data" method=post...
1
by: joe | last post by:
Any articles relating with Uploading images files to server and resize the image by asp.net 2.0
5
by: Deejam | last post by:
hi, i've this situations where user will upload images..my code works fine for uploading images.. but i need to create auto thumbnail picture (of the same image) whenever user upload images......
1
by: thulaseeram | last post by:
I am using iframe to store uploaded images, it is uploading fine in IE but it is not happening in firefox means first time it is uploading image if i try to upload second image it is not calling even...
14
w33nie
by: w33nie | last post by:
What I'm trying to do here, is upload a video to the ../video/ folder, and up to 5 images to the ../images/ folder. As well as the database information like title, content and each file's file...
1
pezholio
by: pezholio | last post by:
Hi, It seems that every time I put together a new script to upload a file I always have problems, here's the latest one: I've got a form with two file input fields, when I submit the form,...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.