HTML form file upload problems (again)


#1

I’m trying to allow users to upload files via an HTML form to a php script. At the advice of this forum, I followed the instructions from the PHP.ini entry in the wiki to the letter, hopefully increasing the maximum upload size from 7MB to 20.

Unfortunately, it still doesn’t seem to work – the file upload fails at some point and the script returns an error. I don’t know if this is because the php.ini fix isn’t taking or there’s a timeout or what. I know it’s not a script bug because it works fine with small files. How should I proceed?


#2

More than 7MB. I’ve tried several, it failed with a file that’s ~6.9 MB, hence the confusion about cause.


#3

To see if your php.ini setting is ‘taking’ or not, create a file containing the line below, browse to this file and you will be able to check if your custom settings are being used.

<?php phpinfo(); ?>

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#4

Mark,

Thanks. The info page showed that the ini file being used was the correct (custom) one. I assume that means I’m hitting some kind of timeout? Can that be changed? Or does it take some time (e.g. a few days) before the ini file settings take effect?


#5

That’s a good start :slight_smile:

If you scroll down a little on the phpinfo page, you should see the current setting for upload_max_filesize, it is probably best to confirm that it is showing what you expect it to show ( 20M ).

The default value for max_execution_time is 30 seconds by default, you might try increasing this to see if it solves your problem.

No, there is no delay, the new settings should take effect as soon as you modify the php.ini file.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#6

OK. The phpinfo shows that the upload_max_filesize and post_max_size are both 20M, and I modified the max_execution_time and max_input_time to 600 seconds.

Still no luck. :frowning:

EDIT: Naturally, the solution appears as soon as I post. Apaprently my script was using a deprecated file variable ($_HTTP_INPUT_FILES or something similar) which the php.ini trick broke for some reason. Well, at least it works now!

Thanks for the help all the same. :slight_smile:


#7

Excellent, I am glad you got it sorted.

Hmmm… perhaps you were using PHP4 before and your custom install is PHP5?

No problem, I am always glad to help where I can. :slight_smile:

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)