ZF-12159: Zend_File_Transfer_Adapter_Http "workaround" causing unexpected behavior with XMLHttpRequest Level 2

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…), 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.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.