babiez4sale Posted June 8, 2011 Share Posted June 8, 2011 Has anyone had an issue with file uploading and $_POST returning empty, specifically on a local server? I can get some files to upload, but others cause $_POST to return totally empty. Quote Link to comment https://forums.phpfreaks.com/topic/238743-file-uploads-and-post/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 8, 2011 Share Posted June 8, 2011 post_max_size integer Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. 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. When an integer is used, the value is measured in bytes. Shorthand notation, as described in this FAQ, may also be used. If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set. As part of your upload error checking logic, you should test for empty $_FILES/$_POST arrays. Quote Link to comment https://forums.phpfreaks.com/topic/238743-file-uploads-and-post/#findComment-1226792 Share on other sites More sharing options...
babiez4sale Posted June 8, 2011 Author Share Posted June 8, 2011 Ok I fixed those values in php.ini, but for some reason, only memory_limit seems to be changed. when I view the actual .ini file, I can see the values that I've set for memory_limit, post_max_size, and upload_max_size, but those values don't seem to apply. Using phpinfo(), I can see I'm editing the correct .ini at /etc/php5/apache2/php.ini, and after restarting the apache server, memory_limit changes to my specified value, but post and upload max size remain at the php default values of 8M and 2M respectively. Any idea on why this would be? Quote Link to comment https://forums.phpfreaks.com/topic/238743-file-uploads-and-post/#findComment-1227061 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.