Jump to content

Recommended Posts

you can do it from within your script (but I would ask your host before changing, you don't want to upset them!) using ini_set('upload_max_filesize', 50M) but I would do this as a temp thing, then once the script has executed switch the value back to default.

 

Hope that makes sense...

 

Rw

I've tried both the methods, but none of them works for me.

1. I have a form, which is handled by a php script. I put "ini_set('upload_max_filesize', 600)" in it (with "600M" (without quotes) it would throw an unexpected string error, with quotes doesn't work either)

2. I created a .htaccess file and put "php_value upload_max_filesize 600M" (w/o qts) in it, and it doesn't work either.

You cannot set it in a script, because the script is not executed until after the upload has been processed by the server.

 

You can only set php settings in a .htaccess file when php is running as an Apache Module AND the web server has been configured to allow you to alter settings in the .htaccess file.

 

You can only set php settings in a local php.ini when php is running as a CGI application AND the web server has been configured to get php to read a local php.ini.

 

Since you are doing this on your localhost development system, you can set it in your master php.ini. Use a phpinfo(); statement to confirm that the setting was actually changed in case the php.ini that you are changing is not the one that php is using. You must also stop and start your web server to get any change made to the master php.ini to take effect.

 

You must also set post_max_size to the larger value.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.