Max file upload size |
[eluser]mvdg27[/eluser]
Hi guys, I'm running into some problems with uploading large file through the upload class. If I select a small jpeg image everything works fine. But as soon as my file goes above 8MB it fails and returns "You did not select a file to upload." Ok. So I checked my phpinfo and indeed te max file upload size is set to 8mb. However in the controller that contains my upload function, I've inserted an ini_set Code: ini_set('upload_max_filesize', '32M'); And the code in my model is quite straightforward: Code: function upload_file($target_folder, $file, $allowed) { Any ideas on how to make my upload work with larger files as well? Thanks in advance!
[eluser]Zeeshan Rasool[/eluser]
did you put a die and print the file name that is being uploaded? Is file name has value Also print all variables one by one Code: function upload_file($target_folder, $file, $allowed) {
[eluser]mvdg27[/eluser]
Yes .. if I print out $file, it prints the string 'file', which corresponds with the name of the upload field. The $_FILES array however appears to be empty, when I do: Code: print_r($_FILES) Guess, that's where the problem really lies. Michiel
[eluser]mvdg27[/eluser]
I have already checked that one. It's set to 8mb, like I described in my first post. I don't really feel like changing the php.ini for all users/ all pages. Just for this specific controller, where I expect to receive files over 8mb. That's why I used the ini_set method. Any reason why that wouldn't work? Michiel
[eluser]Zeeshan Rasool[/eluser]
[quote author="mvdg27" date="1248366919"]Yes .. if I print out $file, it prints the string 'file', which corresponds with the name of the upload field. The $_FILES array however appears to be empty, when I do: Code: print_r($_FILES) Guess, that's where the problem really lies. Michiel[/quote] check like this .. what it prints? its should be some integer value for file size. Also did it works with small size file? I mean did it create problem with only large size? Code: print_r($_FILES[$file]['size'];)
[eluser]coolgeek[/eluser]
I had a similar problem trying to reset session.gc_maxlifetime on a shared hosting environment. The solution was to maintain my own copy of php.ini Here is how it's done on Dreamhost http://wiki.dreamhost.com/PHP.ini#Custom...gle_domain
[eluser]mvdg27[/eluser]
Hi guys, here's an update: In the end I managed to fix it by adjusting the max_post_size variable in my php.ini as well. Now it's working fine, except that I wasn't able to set these values through ini_set(). So for now problem solved .. Cheers, Michiel
[eluser]mvdg27[/eluser]
Sorry .. duplicate message, not patient enough while submitting, I guess
[eluser]renownedmedia[/eluser]
Using ini_set('upload_max_filesize', '***') will not work because the upload is intercepted and ignored by Apache even before it hits PHP. An annoying thing for those of us using shared hosting without php.ini access! |
Welcome Guest, Not a member yet? Register Sign In |