Добрый день
Все утро вожусь, не могу понять. Может ваш свежий взгляд поможет
Есть Flex-web-приложение, загрузчик файлов. В основе содержит mxml компонент

Код AS3:
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:com="*"
layout="vertical" width="100%" minWidth="400" height="100%" minHeight="200"
creationComplete="initCom()" backgroundAlpha="0.0">
<mx:Metadata>
[Event(name="uploadComplete", type="flash.events.Event")]
[Event(name="uploadProgress", type="flash.events.ProgressEvent")]
[Event(name="uploadCancel", type="flash.events.Event")]
[Event(name="uploadIOError", type="flash.events.IOErrorEvent")]
[Event(name="uploadSecurityError", type="flash.events.SecurityErrorEvent")]
</mx:Metadata>
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.managers.*;
import mx.events.*;
import flash.events.*;
import flash.net.*;
//
// Set uploadUrl
public function set uploadUrl(strUploadUrl:String):void {
_strUploadUrl = strUploadUrl;
}
// Initalize
private function initCom():void {
//
}
// Called to add file(s) for upload
private function addFiles():void {
_refAddFiles = new FileReferenceList();
_refAddFiles.addEventListener(Event.SELECT, onSelectFile);
var imageTypes:FileFilter = new FileFilter("Music (*.mp3", "*.mp3");
var allTypes:Array = new Array(imageTypes);
_refAddFiles.browse(allTypes);
}
// Called when a file is selected
private var sss:Array = new Array();
private function onSelectFile(event:Event):void {
var arrFoundList:Array = new Array();
// Get list of files from fileList, make list of files already on upload list
for (var i:Number = 0; i < _arrUploadFiles.length; i++) {
for (var j:Number = 0; j < _refAddFiles.fileList.length; j++) {
if (_arrUploadFiles[i].name == _refAddFiles.fileList[j].name) {
arrFoundList.push(_refAddFiles.fileList[j].name);
_refAddFiles.fileList.splice(j, 1);
j--;
}
}
}
if (_refAddFiles.fileList.length >= 1) {
for (var k:Number = 0; k < _refAddFiles.fileList.length; k++) {
_arrUploadFiles.push({
name:_refAddFiles.fileList[k].name,
ID3name:String(_refAddFiles.fileList[k].name).substr(0,String(_refAddFiles.fileList[k].name).length-4),
size:formatFileSize(_refAddFiles.fileList[k].size),
file:_refAddFiles.fileList[k]});
}
listFiles.dataProvider = _arrUploadFiles;
listFiles.selectedIndex = _arrUploadFiles.length - 1;
}
if (arrFoundList.length >= 1) {
}
updateProgBar();
scrollFiles();
uploadCheck();
}
// Called to format number to file size
public function formatFileSize(numSize:Number):String {
//
}
// Called to remove selected file(s) for upload
private function removeFiles():void {
//сокращено из-за лимита сообщения. ничего важного, действия с массивом
}
// Called to check if there is at least one file to upload
private function uploadCheck():void {
//
}
// Disable UI control
private function disableUI():void {
//сокращено из-за лимита сообщения. ничего важного
}
// Enable UI control
private function enableUI():void {
//сокращено из-за лимита сообщения. ничего важного
}
// Scroll listFiles to selected row
private function scrollFiles():void {
//сокращено из-за лимита сообщения. ничего важного
}
// Called to upload file based on current upload number
private function startUpload():void {
if (_arrUploadFiles.length > 0) {
disableUI();
listFiles.selectedIndex = _numCurrentUpload;
scrollFiles();
// Variables to send along with upload
var sendVars:URLVariables = new URLVariables();
sendVars.action = "upload";
var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = "http://express.ru/upload.php";
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = listFiles.selectedItem.file;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS, onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE, onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR, onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onUploadSecurityError);
_refUploadFile.upload(request, "file", false);
}
}
// Cancel and clear eventlisteners on last upload
private function clearUpload():void {
//
}
// Called on upload cancel
private function onUploadCanceled():void {
//
}
// Get upload progress
private function onUploadProgress(event:ProgressEvent):void {
//
}
// Update progBar
private function updateProgBar(numPerc:Number = 0):void {
//
}
// Called on upload complete
private function onUploadComplete(event:Event):void {
_numCurrentUpload++;
if (_numCurrentUpload < _arrUploadFiles.length) {
startUpload();
} else {
enableUI();
clearUpload();
dispatchEvent(new Event("uploadComplete"));
}
}
//
]]>
</mx:Script>
<mx:Canvas width="100%" height="100%">
<mx:DataGrid id="listFiles" left="0" top="0" bottom="0" right="0"
allowMultipleSelection="true" editable="true" itemEditEnd="empDg_itemEditEndHandler(event)" verticalScrollPolicy="on"
draggableColumns="false" resizableColumns="false" sortableColumns="false" alternatingItemColors="[#F7F7F7, #DCFFE0]" fontFamily="Arial" fontSize="12" fontStyle="italic">
<mx:columns>
<mx:DataGridColumn editable="false" headerText="Файл" dataField="name" wordWrap="true"/>
<mx:DataGridColumn headerText="Название" dataField="ID3name" wordWrap="true"/>
<mx:DataGridColumn editable="false" headerText="Размер" editorDataField="{1,1}" dataField="size" width="75" textAlign="center"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
<mx:ControlBar horizontalAlign="center" verticalAlign="middle">
<mx:Button id="btnAdd" toolTip="Add file(s)" click="addFiles()" icon="@Embed('assets/add.png')" width="26"/>
<mx:Button id="btnRemove" toolTip="Remove file(s)" click="removeFiles()" icon="@Embed('assets/delete.png')" width="26"/>
<mx:ProgressBar id="progBar" mode="manual" label="" labelPlacement="center" width="100%"/>
<mx:Button id="btnCancel" toolTip="Cancel upload" icon="@Embed('assets/cancel2.png')" width="26" click="onUploadCanceled()"/>
<mx:Button label="Upload" toolTip="Upload file(s)" id="btnUpload" click="startUpload()" icon="@Embed('assets/bullet_go.png')"/>
</mx:ControlBar>
</mx:Panel>
На сервере:
upload.php

PHP код:
<?php
$errors = array();
$data = "";
$success = "false";
function return_result($success,$errors,$data) {
echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
?>
<results>
<success><?=$success;?></success>
<?=$data;?>
<?=echo_errors($errors);?>
</results>
<?
}
function echo_errors($errors) {
for($i=0;$i<count($errors);$i++) {
?>
<error><?=$errors[$i];?></error>
<?
}
}
switch($_REQUEST['action']) {
case "upload":
$file_temp = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
$file_path = "Music";
//checks for duplicate files
if(!file_exists($file_path."/".$file_name)) {
//complete upload
$filestatus = move_uploaded_file($file_temp,$file_path."/".$file_name);
if(!$filestatus) {
$success = "false";
array_push($errors,"Upload failed. Please try again.");
}
}
else {
$success = "false";
array_push($errors,"File already exists on server.");
}
break;
default:
$success = "false";
array_push($errors,"No action was requested.");
}
return_result($success,$errors,$data);
?>
Тестируется на локальном сервере Денвер-3 [2008-01-13]
На денвер установлен PHP5
При попытке загрузить файлы на сервер закачиваются только файлы <1мб, остальные просто не закачиваются, хотя прогресс бар отображает процесс загрузки.
Есть подозрение что это ограничение накладываемое денвером, но пока это лишь подозрения.