NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
POST and file size limitations


Joined: 26 May 2007
Posts: 40
Reply with quote
There seems to be a file size limitation of about 2M (just guessing) for the built-in server. I currently work on a script for uploading video files. Those files are naturally large and the system is intended for local use (means not meant to handle huge file uploads over the www using dial-up or stuff like that). I have a test file of 2,610,611 bytes and when I upload the file I get in the array $_FILE a size of 0 and error set to 1. I know the upload would work as I do get the original file name from $_FILE. I tried uploading a small HTML file and that works fine, so it must be an issue with the file size limitation of the server as I did set the PHP ini values to excessive sizes:
ini_set('upload_max_filesize', '50M');
ini_set('post_max_size', '51M');
ini_set('max_execution_time', '600');

Now, where can I set the file size limit for uploads / forms for the built-in server?
View user's profileFind all posts by RamonSSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
built-in server does not care of the file sizes at all. It's php cares. So you need to set the same settings for php Smile. Check with phpinfo() output if you're not sure.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
Which is what I did using ini_set....but I will run the ini_set commands and then check with phpinfo().
View user's profileFind all posts by RamonSSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I'm not sure how you can set it in runtime Smile
Indeed, the upload happens and the limitations are enforced before the very 1st line of your script is executed.
Seems the only way is to change php.ini. See phpinfo() output on where this file is located.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 May 2007
Posts: 40
Reply with quote
Yes, you are right. the PHP manual isn't really straight forward about this, one has to look in three different spots. The weird thing is that I used the exact same code for uploading ZIP archives and during my tests the files must have all been below the default maximum. That's what one gets from crappy test cases.
View user's profileFind all posts by RamonSSend private message
POST and file size limitations
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic