elliotpo Posted November 1, 2011 Share Posted November 1, 2011 Hi. So I've coded many a file upload form and never had any trouble. Until now. For some reason when I try to upload MP3 files, I'll hit submit and the page just reloads. Once it does so, the file upload field is once again blank. What's odd is that images and documents upload just fine. It's only audio tracks that cause the page to reload and clear. My php.ini max file upload size is at this point set to 100M, and the files I'm trying to upload are under 10M. Any ideas? Here's the form code, just to post it-- pretty basic. I'm at a loss here.... Any ideas would be appreciated. Thanks very much. <form action="test.php" enctype="multipart/form-data" method="POST"/> <input type = "file" name = "audio" /> <p><input type ="submit" name="submit" value="do it."/><p> </form> Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/ Share on other sites More sharing options...
Pikachu2000 Posted November 1, 2011 Share Posted November 1, 2011 Are you checking to see if the $_FILES array contains an error? Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1283887 Share on other sites More sharing options...
elliotpo Posted November 1, 2011 Author Share Posted November 1, 2011 Ah see that's the weird thing. I can't get to that point. So, let's say I have the form action directing to page X. We never get to page X: the page literally re-loads, blanking the form field in the process, and any instructions are ignored, or never found. If I then hit submit again, with the file upload form field blank, it goes to the target page and does whatever I want-- in this case giving me error 4 since there's nothing there anymore. You see what I mean? But if I go to load a JPEG, for example, it goes write to the specified page and does whatever. Hence my confusion.... Again, the max file upload size should be no trouble. I'm wondering if there's some other php.ini thing I'm neglecting, or possibly some Apache thing...? Thanks for writing. Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284019 Share on other sites More sharing options...
Pikachu2000 Posted November 1, 2011 Share Posted November 1, 2011 What happens if you rename one of the problem audio files with a different extension, like .jpg? Is this on a hosted server, or local? Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284022 Share on other sites More sharing options...
elliotpo Posted November 1, 2011 Author Share Posted November 1, 2011 When I switch the extension to .jpg nothing changes, I get the same reload. This is local. And it's true that I haven't coded any sites since re-installing my OS and the whole MAMP stack.... Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284026 Share on other sites More sharing options...
Pikachu2000 Posted November 1, 2011 Share Posted November 1, 2011 I've had this problem on Mac, and I don't remember what the cause ended up being. I want to say it had to do with the file size when all was said and done. Do you have some smaller files you can test that theory with? Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284034 Share on other sites More sharing options...
elliotpo Posted November 1, 2011 Author Share Posted November 1, 2011 Ah indeed-- it took a smaller audio file. Thanks. But do you have any idea how this could be remedied for larger files? I was only aware of the max_file_upload size line in the php.ini. There must be other places where such things are specified...? Thanks again-- Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284044 Share on other sites More sharing options...
Pikachu2000 Posted November 1, 2011 Share Posted November 1, 2011 There's also post_max_size, IIRC. I don't know if Apache has a .conf directive or not, but hopefully someone else can chime in on that. Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284049 Share on other sites More sharing options...
elliotpo Posted November 1, 2011 Author Share Posted November 1, 2011 Right, thanks-- this has been helpful, I appreicate it. Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284078 Share on other sites More sharing options...
elliotpo Posted November 2, 2011 Author Share Posted November 2, 2011 And it was in fact the post_max_size. Thanks a million. Quote Link to comment https://forums.phpfreaks.com/topic/250215-html-form-trouble-weirding-me-out-wont-take-audio-file-size-not-the-prob/#findComment-1284331 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.