PDA

View Full Version : How to increase upload file size



iambahar
06-09-2006, 04:11 AM
hi all,

i need a help on increasing upload file size limit. i have edited php.ini file.

but no way! still my upload script showing diffult file size, ie 2MB

plz help me

areidmtm
06-09-2006, 08:20 AM
your php.ini file needs to be in every folder...or at least in the folder where the php script is being called from that needs the php.ini edit

iambahar
06-09-2006, 10:55 AM
Thanks bro, it worked:D

splateye
08-17-2006, 02:25 PM
Basic question - but how dow I know how to find these - I need to amend the file upload size from 2MB to 20MB (using documan and joomla)

areidmtm
08-17-2006, 02:56 PM
Basic question - but how dow I know how to find these - I need to amend the file upload size from 2MB to 20MB (using documan and joomla)

Any folder with php files that need to utilize the new upload sizes, needs to have the new php.ini file with in that folder. If you have a script that is uploading a file, you will need to copy the new php.ini file in to the same folder. If in another folder, there is not PHP files or php is not uploading something, then there is no need to have it in that folder.

Make sense?

Basil
08-17-2006, 03:22 PM
Or you could.. just have one php.ini in the root directory..

dvessel
08-17-2006, 03:42 PM
I wish this was true. php.ini files don't cascade down child directories like .htaccess files. You need one php.ini file for every folder that has a php script you want it to effect.

It would be nice if we could declare php directives inside .htaccess files but it looks like it's turned off in BH servers. That might allow the cascade from a root directory.

bobdog
08-17-2006, 04:26 PM
Basic question - but how dow I know how to find these - I need to amend the file upload size from 2MB to 20MB (using documan and joomla)

Starting at line 255 of the php.ini file edit it:

file_uploads = On ; Whether to allow HTTP file uploads
;upload_tmp_dir = ; temporary directory for HTTP uploaded files (will use system default if not specified)
upload_max_filesize = 30M ; Maximum allowed size for uploaded files

Basil
08-17-2006, 08:39 PM
I guess I'm just used to apache.

splateye
08-17-2006, 11:11 PM
Thanks for all the help - amending the php.ini file sounds easy enough but my problem is that I can't find it!

I'm using joomla - going to system info it tells me that the path is
/usr/local/Zend/etc/php.ini

But after an hour stumbling around I give up - using filezilla, these are my root files:

http://sanguma2005.googlepages.com/site_root

Where do I find the dammed file?

BTW, I've also installed JoomlaExplorer but still can't find it

DEP3
01-05-2007, 02:03 AM
another easy way in .htaccess.



RewriteEngine On
php_value post_max_size 1000M
php_value upload_max_filesize 1000M
php_value max_execution_time 6000000

felgall
01-05-2007, 10:33 AM
Just remember that the default size is set to 2Mb because uploads using that method become extremely inefficient for bigger files. For files bigger than that you really ought to be using an FTP solution as that is what FTP is for. There are FTP extensions for PHP that allow any filesize to be handled efficiently.

Schelly
01-05-2007, 02:54 PM
I agree with Stephan. Whenever possible, it's best for you to use FTP. Not only is it faster and takes less server resources, but it doesn't count against your user bandwidth either. Of course, as generous a bandwidth allowance as we have, that may not seem important. But it never hurts to budget the bandwidth.

Now if only we could get spammers to think along those lines as well...

*sigh*

felgall
01-05-2007, 03:12 PM
See http://www.php.com/ftp for the documentation on how to use FTP from a PHP script in order to bypass (rather than changing) the upload file size limits.

areidmtm
01-05-2007, 03:32 PM
Bluehost does not allow FTP from PHP

dkinzer
01-05-2007, 05:32 PM
Bluehost does not allow FTP from PHPI've been using it since I moved my site here in late summer. It works just fine for me.

I'm using the phpBB Attachments Mod (http://www.phpbb.com/phpBB/viewtopic.php?t=74505) which uses FTP to upload the attachments that the forum members make to their messages.

I do have a dedicated IP; I don't know if that affects this issue or not.

areidmtm
01-05-2007, 06:17 PM
I do have a dedicated IP

Yeah, that's the only way you can.

felgall
01-05-2007, 10:13 PM
Presumably anyone wanting to allow visitors to upload files over 2Mb via PHP ought to have dedicated hosting because changing the size limit to a larger size would probably slow any other sites hosted on the same server and would be an unfair use of resources.

You could always set up an anonymous FTP configuration so that your visitors can FTP to the site instead of using PHP to do it.