Click to See Complete Forum and Search --> : Uploading Files
focus310
06-03-2006, 05:04 AM
Hello:
I'm working on writing a script to upload files. I read somewhere that the max file size you can assign in your php.ini file is 2MB. I have a couple of questions which I hope someone can answer for me.
One, is that a true statement?
Two, what would one do if the file is greater than 2MB?
I would appreciate any suggestions?
Thank you.
GaryS
06-03-2006, 07:07 AM
It's not true. Two settings you need to look at: post_max_size and upload_max_filesize. The latter is (I believe) set to 2MB as a default.
focus310
06-03-2006, 07:11 AM
Hi,
Thank you for the reply. So I can set those settings to whatever size I want. Am I correct?
GaryS
06-03-2006, 07:22 AM
It may be that you'll run into some other limitation at some point. Main issue is one of usability: it's a long wait with nothing happening when a user uploads a large files (although there are ways to mitigate this).
focus310
06-03-2006, 08:18 AM
Besides the 2MB that is set as a default, what would be the largest size file to upload so there isn't a long wait?
GaryS
06-03-2006, 10:42 AM
Where I've used large uploads, it's been for an administration website. Here I have the luxury of being able to tell the administrations: "if you upload a 10Meg file it's going to take a while!"
For a "public" website, I'd hestitate to allow files as big as that. You can, of course, warn the user before they upload... and it would be possible to (for example) display an animated to gif to give the impression that something is happening. I've also read about people using aplets to control file uploads... which (I think) gets around the big problem with uploads: to know how big a file is... you have to upload it!!
purefan
06-03-2006, 11:35 AM
you need to bare in mind that ini_set does not always work, you also need to set some other values in the php.ini file and that is the only way to make sure youŽll get them uploaded, for instance there is a max execution time that if set too low and uploading files too big simply will cut it right in the middle...you shold read the php.net/ini_set and arounds for more information
plus there is an excellent guide on how to upload files in this forum
focus310
06-03-2006, 12:04 PM
Hi,
Thank for all the input. I'll do some more research. Maybe my hosting company can help me out as well.