Jump to content

Problem uploading images with Firefox for MAC.


robjan

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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';

?>

Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.