Issue Type: Bug Created: 2012-04-16T22:11:21.000+0000 Last Updated: 2012-04-16T22:11:21.000+0000 Status: Open Fix version(s): Reporter: Ondrej Machulda (ondram) Assignee: Thomas Weidner (thomas) Tags: - Zend_File_Transfer
Related issues: Attachments:
This bug is related (but not duplicate) of an ZF-10279.
When you are using FormData (from XMLHttpRequest Level 2 - see http://dvcs.w3.org/hg/xhr/…), aka "AJAX file upload", and you don't select any file, the $_SERVER['CONTENT_LENGTH'] will be > 0. This is not a bug, but correct behavior according to the W3 specs (the form is send as multipart, but there is file missing, so the file item is treated as string not File or Blob object, and then the Content-Type: application/octet-stream header is not added). The $_FILES is empty then, but it confuses ZF, because the $content is larger than 0, which activate the "workaround", add error = 1 and resulting in confusing "File exceeds the defined ini size" (fileUploadErrorIniSize) error warning of Zend_Validate_File_Upload.
Because browsers are already getting support of the direct XMLHttpRequest file upload methods, I suppose this has to be somehow detected (maybe with the fix proposed in the ZF-10279?).
No comments to display
Have you found an issue?
See the Overview section for more details.