弯曲动作不上传文件到PHP页面的帮助! [英] flex actionscript not uploading file to PHP page HELP!

查看:171
本文介绍了弯曲动作不上传文件到PHP页面的帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮忙!我使用的ActionScript 3的使用的Flex SDK 3.5和PHP,以允许用户上传的文件 - 也就是我的目标。但是,当我检查我的服务器目录中的文件......无所不有!出于某种原因,事情错了,即使动作提醒上传成功(我甚至尝试了所有的事件监听器上载错误,并没有被触发)。我还测试了PHP脚本,并上传成功接收来自另一个PHP页面的文件时(所以我留下来相信有什么错我的PHP)。

不过,动作是不是当我上传-in其实给我任何错误,它给了我一个成功的活动......我知道我的Flex应用程序实际上是试图发送,因为当我试图上载一个大文件中的数据,它需要显著更多的时间来提醒成功事件时相比,我上传一个小文件。

我觉得我已经调试这code每一个方面,我现在用了。 pleaseeee,任何人,你能告诉我怎么回事错了?或者至少我怎么可以找到发生了什么? -I'm使用闪光灯开溜,我仍然得到零误差。 - 我也可以上传没有任何问题。

 私人变种fileRef:的FileReference =新的FileReference();
私人VAR flyerrequest:的URLRequest =新的URLRequest(http://mysite.com/sub/upload_file.php);

私有函数uploadFile():无效{
fileRef.browse();
fileRef.addEventListener(每个所选的);
fileRef.addEventListener(引发Event.COMPLETE,在completeHandler);
}


私有函数每个所选的(事件:事件):无效{

fileRef.upload(flyerrequest);
}

私有函数在completeHandler(事件:事件):无效{
Alert.show(上传);
}




< PHP
move_uploaded_file($ _ FILES ['Filedata上'] ['tmp_name的值'],./test/".$_FILES['Filedata']['name']);
?>
 

解决方案

一些想法:

  1. 有你搭配chmod您的服务器777上的目录。

  2. 补充IOErrorEvent.IO_ERROR的事件监听器在脚本中检查是否存在IO错误。

  3. 看看,试试下面的例子的http://博客。 cahlan.com/2006/12/flex-upload-component.html ,也有它的意见看看。

please help! I am using actionscript 3 with flex sdk 3.5 and PHP to allow a user to upload a file -that is my goal. However, when I check my server directory for the file... NOTHING is there! For some reason SOMETHING is going wrong, even though the actionscript alerts a successful upload (and I have even tried all the event listeners for uploading errors and none are triggered). I have also tested the PHP script and it uploads SUCCESSFULLY when receiving a file from another PHP page (so i'm left to believe there is nothing wrong with my PHP).

However, actionscript is NOT giving me any errors when I upload -in fact it gives me a successful event...and I know the my flex application is actually trying to send the data because when I attempt to upload a large file, it takes significantly more time to alert a "successful" event than when I upload a small file.

I feel I have debugged every aspect of this code and am now spent. pleaseeee, anyone, can you tell me whats going wrong?? or at least how I can find out whats happening? -I'm using flash bugger and I'm still getting zero errors. -I can also UPLOAD without any issues.

private var fileRef:FileReference = new FileReference();
private var flyerrequest:URLRequest = new URLRequest("http://mysite.com/sub/upload_file.php");

private function uploadFile():void{
fileRef.browse();
fileRef.addEventListener(Event.SELECT, selectHandler);
fileRef.addEventListener(Event.COMPLETE, completeHandler);
}


private function selectHandler(event:Event):void{

fileRef.upload(flyerrequest);
}

private function completeHandler(event:Event):void{
Alert.show("uploaded");
}




<?php
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./test/".$_FILES['Filedata']['name']);
?>

解决方案

Some idea:

  1. have you chmod the directory on your server to 777.

  2. add the EventListener of IOErrorEvent.IO_ERROR in the script to check whether there is io error.

  3. take a look and try the following example http://weblog.cahlan.com/2006/12/flex-upload-component.html and also have a look on its comments.

这篇关于弯曲动作不上传文件到PHP页面的帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆