Hi StackOverFlow community.
I'm having a strange PHP issue, i can't solve it by myself, i already tried everything i know. Basically, i have a music upload website. The upload form has some fields (Music, band, subgenre, notes, upload [the file], and genre [this is the once field that the user don't need to write anything, automatic]. The fields "music" and "files" CANNOT BE NULL.
Well, many musics are uploaded normally but some of them causes the strange behavior.
THE PROBLEM: Even filling all the fields (including the "music" and "files", or course), shows me the message (written by me in the script) "Please, feel at least the music name". But i wrote it! THEN, i tested if the $_POST variables are being set, and everytime happens this error, any $_POST/$_GET variables are null. This happens specially if the music takes more time to be uploaded. Also, NO PHP ERRORS HAPPENS. Nothing.
NOTES: - I already tried "set_time_limit(0);" - I already changed the "max_upload_size" and the other one, i had the size problem before and i solved it. The max is 20mb and the music i'm trying upload is just 9mb. - I already did the print_r($_POST) and returns to me "array ()", nothing.
Here is my code, if you want to see it:
I'm pretty sure that the error is in PHP.ini, i tried put
ini_set('max_execution_time', '3600');
ini_set('max_input_time', '3600');
But most of the times, ini_set doesn't work.
How to solve it? It's very critical.. Thanks in advanced.
@EDIT
The form script file:
The queries on that script is not important for the upload.
If you are unable to modify the php upload size or post size (assuming that is what is causing the issue which sounds likely) it may be worth looking at some sort of chunked upload solution. Something like http://www.plupload.com/ may be worth taking a look at.
This will allow you to keep the chunks uploaded below the servers upload limit and then rebuild the file serverside after it has finished uploading. At also allows you to show quite a neat little progress bar to the user whilst they are waiting.
It has various runtimes including html5 and requires very little configuration to get it working. The only thing you will need to do is change the flow of the form submission process. So catch the form submit, trigger the upload using plupload and then when the upload is complete post the rest of the form data.
I know it's not a direct solution to the issue you are having but it's a good alternative that may avoid some of the issues you're having.