Author Topic: Cannot upload large files (larger than 2Mb)  (Read 200995 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Cannot upload large files (larger than 2Mb)
« on: March 17, 2005, 04:15:49 AM »
Quote
Iīve got a problem uploading images or files larger than 2 MB. i have changed the image size in the settings but I still canīt upload more than 2 MB - it doesnīt even give me an error message. Does anyone have an idea of what could be wrong?

This is a limitation of your server's PHP configuration.  2Mb is the default upload file size limit when PHP is installed on a web server.  Only your hosting provider can change this setting inside php.ini

The other option is to first upload the file via FTP and then use the "Check New Images" function inside the admin control panel

[UPDATE]
Thanks to techmob for additional info on this topic.

The following settings in php.ini affect files upload:
Quote
file_uploads
1 to accept file uploads, 0 to not accept file uploads. Defaults to 1.


post_max_size
This is the maximum size of a POST request that PHP will accept. The default for PHP 4.3.x is 8M. If the file(s) you are trying to upload have a single or combined size over this value, PHP will exit. This affects the total post data. For example, if this were set to 8M and you are uploading four 3M files, PHP would not accept the files. You could, however, upload the four 3M files individually without a problem from this setting.


upload_max_filesize
This is the maximum size of an individual uploaded file. The default for PHP 4.3.x is 2M.


max_input_time
This is the maximum time PHP will accept input in seconds. The default for PHP 4.3.x is 60.

If you have access/persmission to modify settings directly in php.ini, do that, but if you can't do that AND your server is using Apache or other type of server that support .htaccess then you can insert the following into .htaccess in your gallery:
Code: [Select]
php_flag file_uploads on
php_value post_max_size "8M"
php_value upload_max_filesize "2M"
php_value max_input_time "60"
Change the values to satisfy your needs ;)
« Last Edit: September 01, 2006, 12:52:11 AM by V@no »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Cannot upload files larger than 2Mb
« Reply #1 on: March 24, 2005, 02:37:56 PM »
Another possible sollution is add
Code: [Select]
php_value upload_max_filesize "8M"into .htaccess file into your 4images root dir. (in this case it should change the max upload size to 8mb

Note, that this method is not 100% guaranteed working.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline whoopiedoo2

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #2 on: August 03, 2005, 01:53:03 AM »
where do i upload the images to when doing it with ftp?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Cannot upload files larger than 2Mb
« Reply #3 on: August 03, 2005, 02:26:32 AM »
Please continue read FAQ, you almost there :P

P.S. this makes wonder, what in this topic made u ask such unrelated to the topic question?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jdm

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #4 on: February 17, 2006, 10:26:38 AM »
Hi dear friends.
I have been reading this whole week about this "2Mb image problem" and I tryed everything I could.

1. My server provided me a file php.ini where I changed the max file to 15 MB
* Nothing changed...

2.I tryed to make  the htaccess file with:
php_value upload_max_filesize "15M" inside.
* the page gets offline with this error message:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster@yoursite.com and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.  8O

3 I removed the .htaccess and everything came back to normal again. :roll:

This is what my server told me aboout .htaccess:

That's because of phpsuexec, which is incidentially the reason why the php.ini thing works.
More on that subject here:
http://ion-web.com/forum/showthread.php?t=3D1053

So, yank that out of the .htaccess, as it won't work.  The php.ini thing should work for you though, just copy the file over.

4.My server Checked out the upload_max_filesize listed on my site
with test.php:


It's currently set to 15 megabytes.  That's what it should be, which would indicate that the problem lies not with PHP but perhaps with something else.

5 Do you have any idea of what possibly is going on? Because neither I nor the server knows ??

Thank you for any help :oops:




Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Cannot upload files larger than 2Mb
« Reply #5 on: February 17, 2006, 01:19:07 PM »
If you can use your own php.ini you must put the custom php.ini in each Folder where the Script is need the changes...

I think is it not enough to put the custom php.ini in the root Folder, then i think the custom php.ini has no recursive effekt...

I hope you understand my bad english... *g*


Offline Jdm

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #6 on: February 17, 2006, 02:32:15 PM »
Thanks! I will try this :)
No problem with your english. It is not my first language either  :mrgreen:

Offline Jdm

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #7 on: February 19, 2006, 04:20:30 PM »
Nope it doesnt work :(

I put the php.ini file EVERYWHERE but nothing happens :(
I put on the data directory, media, all the folders!
Nothing really!

Please could you try to think of something else I could try to do?
This is really making me nuts!


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Cannot upload files larger than 2Mb
« Reply #8 on: February 19, 2006, 07:31:18 PM »
A link to your phpinfo could help ;) (refer FAQ for more info)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: Cannot upload files larger than 2Mb
« Reply #9 on: February 20, 2006, 05:24:00 PM »
I put on the data directory, media, all the folders!

Not in the data Folder... (o:

You must put them in the Script Folder...

Like this:
/php.ini
/includes/php.ini
/admin/php.ini

Offline Jmello

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #10 on: February 20, 2006, 09:06:57 PM »
My php :

http://www.brassar.se/galleria/test/test.php

I am very ashamade to say this, but it didnt worked :(
Please... Is there anything else I could do?  :cry:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Cannot upload files larger than 2Mb
« Reply #11 on: February 21, 2006, 12:38:19 AM »
So, how big where the files you tested with? 2mb? 3mb? what is the max size you CAN upload?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jdm

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #12 on: February 21, 2006, 02:15:59 AM »
1,107 is the heaviest so far  :oops:

Offline Jmello

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Cannot upload files larger than 2Mb
« Reply #13 on: February 22, 2006, 03:22:59 PM »
I am trying a 3 MB file.. Doesnt work.. Just via ftp :|

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Cannot upload files larger than 2Mb
« Reply #14 on: February 24, 2006, 02:05:40 AM »
Ok, lets test it, shall we? ;)
In member.php find:
Code: [Select]
if ($action == "uploadimage") {Insert below:
Code: [Select]
echo "<pre>";
print_r($HTTP_POST_FILES);

Then upload a small file, then a big file and post the text that should be showed on top of the page for both files. (disregard any warning messages that may appier as well)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)