robjan Posted January 22, 2012 Share Posted January 22, 2012 I developped a cms system to upload images with php to a mysql database and a upload folder on the server. Firefox version 5.0.1 for MAC and earlier have no problems with uploading through the script. But after that version it is impossible to upload images bigger then 250kb. The page where the customer chooses his image for upload stalls and the form is not sent to the actual upload script, which should validate and process the image. This problem only occurs in Firefox, all other browsers work just fine! I tried to run the same script with Firefox on a PC and everything works fine. So it is a Mac related problem. You can try for yourself to see what happens in the following basic script (if you don't get a succes message it means that you are still hanging on the image_upload page and nothing has happened) : http://siteways.net/test_upload/image_upload.php Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 22, 2012 Share Posted January 22, 2012 What type of image and its file size are you trying to upload? And what is your .php logic that detects the image type? The reason I ask this is because different browsers and different versions of any one browser send different mime type for the same file and this is the most common reason why file upload scripts operate unexpectedly for the same uploaded file. Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1310012 Share on other sites More sharing options...
robjan Posted January 22, 2012 Author Share Posted January 22, 2012 The validation of the form where you choose the image to upload is not done on the same page, so the problem with the script (or rather Firefox) is that it doesn't even get sent to the upload script where everything should take place (validation, and upload to database. Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1310024 Share on other sites More sharing options...
PFMaBiSmAd Posted January 22, 2012 Share Posted January 22, 2012 When the target page of a form submission 'hangs' (i.e. a forever loop or takes a really long time to process), the form page sits there until a connection timeout or a script timeout occurs, because it has not received a complete http response back from the server. Your symptom in the form page is most likely being caused by your form processing page not finishing and sending a complete http response back to the browser. Start by debugging your form processing code. Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1310027 Share on other sites More sharing options...
PFMaBiSmAd Posted January 22, 2012 Share Posted January 22, 2012 You can confirm this by adding the following line of php code to the beginning of your php code in the processing page - die('Processing page reached'); Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1310029 Share on other sites More sharing options...
robjan Posted January 22, 2012 Author Share Posted January 22, 2012 Ok once more: the form page looks like this (stripped for testing purpose). I can upload an (jpg) image with a max size of 250kb and everything works fine. Bigger than that the form page is NOT sent, and the update page never reached. <title>Website Maintenance</title> <link href="../css/admin.css" rel="stylesheet" type="text/css" /> <script language="JavaScript"><!--function for progress icon--> function setVisibility(id, visibility) { document.getElementById(id).style.display = visibility; } </script> </head> <body> <form action="update.php" method="post" enctype="multipart/form-data"> <h2>New Picture</h2> <table width="auto" align="center" border="1" bordercolor="#900" cellspacing="0" cellpadding="3"> <tr height="30"> <td style="color:#FFF" width="100">New Picture </td> <td align="center"> <input type="file" name="Foto" /> </td> <td style="color:#FFF" width="195" id="formupdate_italic">Max upload size = 6 Mb (6000kb)</td> </tr> </table><br /><br /> <table width="auto" align="center" border="1" bordercolor="#333" cellspacing="0" cellpadding="3" bgcolor="#00CC00"> <tr height="30" align="center"><td width="20"> <input type="submit" onclick="setVisibility('progress_icon', 'inline');" name="edit" value="save"/></td></tr> </table> <!--div for showing upload in progress--> <div class="progress_icon" id="progress_icon" align="center"> <table width="100%" border="0"> <tr> <td align="center"><br />Uploading Image to your Database, please wait....</td> </tr> <tr> <td align="center" style="font-size:11px"> <br />Average upload time for : 1MB -> 30 sec. , 2MB -> 45 sec. , 4MB -> 90 sec. , 6MB -> 3 min.<br /> <br />For faster uploads resize your images to 2100pixels x 1400pixels x 72dpi !! ( jpeg quality 10 )<br /> <br />Images are resized before uploading, so you only loose time trying to upload bigger images. <br />Horizontal panoramic images should have a max. height of 1400px for fast uploading. </td> </tr> </table> <br /> </div> </form> </body> </html> And this is the page (update.php)for processing which i stripped to be sure that nothing is wrong there, but it is never reached by the form submission. <?php $Foto = $_FILES['Foto']['name']; echo 'you have reached the upload page succesfully.<br /> you normally would have uploaded '. $Foto. ' to our datebase,<br /> but in this case it is just a testing page'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1310032 Share on other sites More sharing options...
robjan Posted February 6, 2012 Author Share Posted February 6, 2012 Apparently FF has discovered the bug and the newly released version 10 is working properly again, with uploading images. So despite of being curious what the reason was for this issue, i guess this can be seen as problem solved. Quote Link to comment https://forums.phpfreaks.com/topic/255514-problem-uploading-images-with-firefox-for-mac/#findComment-1315019 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.