SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: File Upload Error
-
Dec 29, 2008, 09:57 #1
- Join Date
- Nov 2005
- Location
- Karachi - Pakistan
- Posts
- 1,134
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
File Upload Error
Hi
I am trying to upload a XLS file through PHP. the file size is > 2MB
in my form here is the file size thing.
Code:<input type="hidden" name="MAX_FILE_SIZE" value="350000000" class="hidden"/>
PHP Code:session_start();
ini_set ('max_execution_time', '86400');
set_time_limit(86400);
ini_set('max_upload_filesize', "30M");
ini_set("post_max_size", "30M");
ini_set("session.gc_maxlifetime","10800");
The filename blah/blah is not readable.
When i see the php_info that shows me the post_max_size is 10M and the max_upload_filesize is 2M, so i tried to over write both by above php code.
but still i m getting the error, please help !
Thanks
Zeeshan
-
Dec 29, 2008, 10:23 #2
- Join Date
- Jul 2008
- Posts
- 5,757
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Certain php configuration settings cannot be changed at runtime. This is because php does certain things before it even executes your script, so it's too late. Uploads are one of these. You need to change some in php.ini, or in the webserver context(httdpd.conf / .htaccess).
You can learn more here:
http://www.php.net/manual/en/configuration.changes.php
http://www.php.net/manual/en/ini.list.php
Bookmarks