473,387 Members | 1,464 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,387 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 2696
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,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.