Why would some POST data go missing when using Uploadify?

Posted by Chad Johnson on Stack Overflow See other posts from Stack Overflow or by Chad Johnson
Published on 2010-04-19T22:40:31Z Indexed on 2010/04/19 22:43 UTC
Read the original article Hit count: 375

Filed under:
|
|
|

I have been using Uploadify in my PHP application for the last couple months, and I've been trying to track down an elusive bug. I receive emails when fatal errors occur, and they provide me a good amount of details. I've received dozens of them. I have not, however, been able to reproduce the problem myself. Some users (like myself) experience no problem, while others do.

Before I give details of the problem, here is the flow.

  • User visits edit screen for a page in the CMS I am using.
  • Record id for the page is put into a form as a hidden value.
  • User clicks the Uploadify browse button and selects a file (only single file selection is allowed).
  • User clicks Submit button for my form.
  • jQuery intercepts the form submit action, triggers Uploadify to start uploading, and returns false for the submit action (manually cancelling the form submit event so that Uploadify can take over).
  • Uploadify uploads to a custom process script.
  • Uploadify finishes uploading and triggers the Javascript completion callback.
  • The Javascript callback calls $('#myForm').submit() to submit the form.

Now that's what SHOULD happen. I've received reports of the upload freezing at 100% and also others where "I/O Error" is displayed.

What's happening is, the form is submitting with the completion callback, but some post parameters present in the form are simply not in the post data. The id for the page, which earlier I said is added to the form as a hidden field, is simply not there in the post data ($_POST)--there is no item for 'id' in the $_POST array. The strange thing is, the post data DOES contain values for some fields. For instance, I have an input of type text called "name" which is for the record name, and it does show up in the post data.

Here is what I've gathered:

  • This has been happening on Mac OSX 10.5 and 10.6, Windows XP, and Windows 7. I can post exact user agent strings if that helps.
  • Users must use Flash 10.0.12 or later. We've made it so the form reverts to using a normal "file" field if they have < 10.0.12.

Does anyone have ANY ideas at all what the cause of this could be?

© Stack Overflow or respective owner

Related posts about php

Related posts about uploadify