我正在使用 Adobe Air 部署一个小型应用程序。我的应用程序将从存储在文本文件中的文件路径进行批量上传。
例如,在文本文件名“list.txt”中,有一个字符串“C:\myfiles\IMG_0001.JPG”。现在我想上传这个图像文件,跟踪上传进度:-<
我想使用 FileReference 获取上传进度,但我不知道如何从文件路径导入。我还想知道如何使用 FileReference 上传此文件而不提示用户选择文件的对话框。
非常感谢你:)
最佳答案
尝试以下操作。
我使用以下代码完成了没有对话框的文件上传。
var uploadURLs:URLRequest = new URLRequest("Your upload URL Here");
var params:URLVariables=new URLVariables();
params.title = "Hello";//URL Parameters if there is any
uploadURLs.data = params;
uploadURLs.method=URLRequestMethod.POST;
file = new File("Path to File");
file.addEventListener(ProgressEvent.PROGRESS , updateProgress);
file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, doneUpload);
file.addEventListener(IOErrorEvent.IO_ERROR,fileError);
file.upload(uploadURLs);
希望这有帮助
关于apache-flex - 没有 FileReference 的 Adobe Air 上传进度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2577540/