Flex,Firefox 中的 FileReferences upload() 错误
https 区域中的 swf 文件,http 区域中的上传脚本。 文件上传在 ie 中正常,但在 firefox、opera 上不起作用。
这段代码:
request.url = this.main.serverHostUpload + "/upload_web.php";
request.method = URLRequestMethod.POST;
request.contentType = "multipart/form-data; boundary=" + UploadPostHelper.getBoundary();
request.data = new URLVariables();
request.data.dst_file = fileDstName;
request.requestHeaders.push( new URLRequestHeader( 'Cache-Control', 'no-cache' ) );
var fr:FileReference = this.main.photos[this.iLoadPh].fr;
fr.cancel();
fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,createOrderStep6Res);
fr.upload(request,"file");
swf file in https zone, upload script in http zone.
File upload fine in ie, and not work on firefox, opera.
this code:
request.url = this.main.serverHostUpload + "/upload_web.php";
request.method = URLRequestMethod.POST;
request.contentType = "multipart/form-data; boundary=" + UploadPostHelper.getBoundary();
request.data = new URLVariables();
request.data.dst_file = fileDstName;
request.requestHeaders.push( new URLRequestHeader( 'Cache-Control', 'no-cache' ) );
var fr:FileReference = this.main.photos[this.iLoadPh].fr;
fr.cancel();
fr.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,createOrderStep6Res);
fr.upload(request,"file");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到过类似的问题,如果您通过 https 发布,有时是证书的质量问题。您还应该确保 fileference 使用实际端口号(https 为 443)调用 URL。
我还在 IE 以外的浏览器中看到了火灾引用重新连接。您可以使用 Firefox 或 Fiddler 的 Tamper Data 之类的工具来发现这一点,以获得它的 NIC 级别视图。
I have had similar problems and sometimes it is the quality of the cert if you are posting over https. You also should make sure that fileference is calling a URL with the actual port number (443 for https).
I have also seen fire reference reconnect in browsers other than IE. You can spot this using something like Tamper Data for Firefox or Fiddler to get a NIC-level view of it.