Reputation: 3546
After moving a web site to another server flash upload stopped working. After some debuging and isolating the problem I found out that in SWF file (used for multiple upload) FileReference.upload() method doesn't work. URL called by item.upload(_root.uploadScript) isn't called.
Here is the code:
flash:
listener.onSelect = function(fileRefList:FileReferenceList){
var list:Array = fileRefList.fileList;
var item:FileReference;
_root.toUploadCount = list.length;
for(var i:Number = 0; i < list.length; i++) {
item = list[i];
if(item.size > maxSize)
ExternalInterface.call("tooBig", item.name);
else{
item.addListener(this);
item.upload(_root.uploadScript);
}
}
}
upload.php:
<?php
$log = fopen('log.txt', 'a');
fwrite($log, 'Upload');
fclose($log);
item.upload(_root.uploadScript) returns true, but log file isn't created.
CHMOD is set correctly, direct call of upload.php creates log.txt as expected and everything worked on the previous server.
Please help, I'm clueless.
Thanks.
Upvotes: 0
Views: 390
Reputation: 3546
I found a solution.
Server was returning HTTP Error 406. To prevent this behavior I needed to add to .htaccess file this:
SetEnvIfNoCase Content-Type "^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
Upvotes: 1