PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Ok... I have a file upload script that works just fine and uploads files no problem. The only thing is that it seems to have a file size limit or something. I want to be able to set the limit and upload files up to or over a gig in size. Is this possible with what I have below? Do I need to do it different maybe?
im sure its possible, you would have the change the file size hidden field on your form to a gig. also change max_file_size in your php.ini to a gig and also change your time out in seconds thing to like a billion in your php.ini because it would take forever to do that. but ya its possible
My problem isn't really that I want to be able to upload gigs of stuff it's that I can't even upload 15 or 16mb. Either way though its something I have to change on the server though? Guessing I can't just do that myself can I?
It's an apache configuration issue. The default size is 15MB (I think ) . You'll need acess to the server to change it... Not sure that .htaccess will make a difference for this sort of thing.
ok, if my php.ini says my 'post_max_size' is 55M I should be able to upload up to 55mb if I set the set_time_limit() to an hour (3600 sec) or something shouldn't I? Does anyone have an example of this that works?
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="e;hidden"e; name="e;MAX_FILE_SIZE"e; value="e;30000"e; />
You also need to set this value to > 15 MB, or you'll get a 'file too big' error.
Note that this is in addition to php.ini
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
I already have that and it doesn't work. (Sorry, guess I didn't post that initially). Also though I'm not getting my IF statement to return that the "file is too large" it tells me that the "file has no file size" (like the server wont let me upload it or something).
yes, I've tried different files (different sizes, etc). Everywhere I look everyone says the 'default' php.ini file upload is 2mb. I believe mine says 55mb (if I'm reading it correctly) but I dont know how to actually upload that or change it to let me upload that.
I have set_time_limit(4800) on the page that it posts to so I would think that that would get rid of any 'time' related issues. As I said before my php.ini says 55M for the post_max_size. So it seems that everything 'should' work. Dont know what to do
If there is one thing which is affected by many other things, it would be file uploads...
PHP manual wrote:If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
Default for memory_limit is 8M if I'm not mistaken.