Old 16-04-2007, 22:57   #1 (permalink)
HRK
Registered User
 
Join Date: Apr 2007
Posts: 7
PHP max file size upload

I'm going to use an upload form on my site, and I know that one needs to edit the php.ini file to raise the maximum file size upload through PHP above 2mb, but I have 2 questions:

1. Is there a performance disadvantage (time-outs, heavy server load while uploading, etc.) to allowing larger uploads (around 10mb)?

2. If I'm using a hosting company like GoDaddy (which I am), can I convince them to change php.ini to allow bigger files?

Thanks!
Aaron
  Reply With Quote
Old 16-04-2007, 23:34   #2 (permalink)
gk
geek
 
gk's Avatar
 
Join Date: Oct 2006
Location: *.everywhere
Posts: 204
Send a message via ICQ to gk Send a message via AIM to gk Send a message via MSN to gk Send a message via Yahoo to gk
The only disadvantage that I can think of would be a greater storage space/bandwidth requirement. Handling multiple large files uploads at one time means more stress on the server.
  Reply With Quote
Old 17-04-2007, 05:51   #3 (permalink)
freelancr
Senior Member
 
freelancr's Avatar
 
Join Date: Oct 2006
Posts: 2,175
1. All depends how busy your website is, and wether you have good hosting. PHP by default limits this to 2mb, ASP.NET by default limits this to 4mb. E-Mail is usually limited to 10mb. You may find it sucks up your bandwidth if people abuse it (upload a file, then link to the file from their own website), but shouldn't really cause an issue if you are careful and don't have a busy website.

2. You are able to change some PHP options on the fly in your code, so perhaps this is one of the things too, you will have to google it. I know with ASP.NET you can change the limit per website. But no, I doubt GoDaddy will change the PHP.ini for you as it will be serving thousands of websites and requires apache to be restarted.
  Reply With Quote
Old 17-04-2007, 21:48   #4 (permalink)
richgraphicd
Registered User
 
Join Date: Mar 2007
Location: Southern California
Posts: 3
In regards to your second question, it doesn't hurt to shoot them an e-mail to see if they can help you out.

I got my webhosting company, IX Webhosting, to change the php upload limit from 2 mb to 5 mb for a site I was working on.
  Reply With Quote
Old 31-05-2007, 07:00   #5 (permalink)
LazyMoon
Registered
 
LazyMoon's Avatar
 
Join Date: Sep 2006
Location: Adelaide, Australia
Posts: 12
It's quite unlikely you will get your host to change your php.ini file as it would affect other users on the server (I presume your account is shared hosting).

If your host refuses, you can always (rather easily) use .htaccess files to change the PHP settings. If your stuck with that option, respond and I'll explain how. (Of course this only applies if you are hosted on a Linux plan with Apache).

As for large uploads, it doesn't put much strain on the server but a slight strain on the connection. But unless we're talking about thousands of users uploading 10MB at a time then you probably wont have any real issues.

The real server strain comes with what you do afterward with the file. Really the only time you have to worry is if you are using PHP's GD library to alter images or maybe extract ZIP archives. Other than that you should be in the clear (free space permitting of course )
  Reply With Quote
Old 31-05-2007, 07:28   #6 (permalink)
Cborrow
I like code.
 
Join Date: Dec 2004
Location: Chesapeake, VA
Posts: 229
Send a message via AIM to Cborrow
You can set it from PHP with

Code:
ini_set("upload_max_filesize", "10M");

though you might still want to ask your host first as they may not like that.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8