douang4294 2013-02-13 07:52
浏览 121
已采纳

在Web服务器问题上部署Flex应用程序

I have a simple flex application that can upload local files. It is a simple button, and on click event a file dialog appear.

The selected files are then processed by a PHP script and works great on my local machine. When i try to move my flex-debug, or flex-release project to a remote server the upload functionality doesn't work any more.

If a inspect the network the POST is executed but for some reasons it has status of pending for 1 minute, but after success is doesn't run well, as expected, the files are not uploaded.

// file is a file:FileReference object
var uploadURL:URLRequest = new URLRequest();
var params:URLVariables = new URLVariables();
file.addEventListener(Event.COMPLETE, uploadComplete);
params.maxSize = maxSize;
uploadURL.method = URLRequestMethod.POST;
uploadURL.data = params;
uploadURL.url = uploadScript;
file.upload(uploadURL, IMAGE_FIELD);
file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, uploadDataComplete);
file.addEventListener(Event.COMPLETE, uploadComplete);    

Edit: When i try to move my debug folder generated from Flash Builder 4.5 from C:\www to my second local host on D:\www the upload script doesn't work anymore. Maybe i miss some deployment options and only sees it on C:\www where my .mxml reside.

Edit2: There was a problem on remote server i.e. move upload file function was not working properly. The problem was from upload.php script and not from Flex after all, thanks for help and sorry for disturbance.

  • 写回答

3条回答

  • doubeishuai6598 2013-02-13 14:37
    关注

    Try to use:

    var request : URLRequest = new URLRequest("http://{you_site_domain}/upload.php");
    

    and check

    loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, ioErrorHandler);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题