FileReference URLrequest上传文件的问题:Session丢失
2012-12-03 15:15
513 查看
FileReference使用的URLRequest和Flash所在页面用的不同的Session. 所以即使你已经登录,由于上传的请求用的是不同的Session,服务器无法得知请求已经验证。 Adobe文档如此解释
The FileReference and FileReferenceList classes also do not providemethods for authentication. With servers that require authentication,you can download files with the Flash® Player browserplug-in, but uploading (on all players) and downloading (on thestand-alone
or external player) fails. Listen for FileReference eventsto determine whether operations complete successfully and to handleerrors.
翻译过来就是 FileReference 不支持验证功能。
解决方法
1. 不使用FileReference,而使用form post上传文件。这样和普通的Html页面一样了。
2. 将Session id传到服务器。 如果你使用的Server是TomCat/JSP 可以如下添加SessionID. var request:URLRequest = new URL Request("http://www.[your url].com" ";jsessionid=" _yoursessionid); 3. 不验证Session,而检查上传ID。比如每次上传前,服务器生成一个ID,上传的时候把这个传ID作为URLRequest的参数传过去。
4. 将需要验证的用户名密码,添加至URLRequest的参数,在服务器端进行验证,然后在服务器端,将用户信息存入session,这样,只要flex页面session不变,下次提交请求时,服务器端的session就是保存用户信息的session。
5. 等待adobe发布hotfix.
参考:
http://bbs.airia.cn/FLEX/thread-732-1-1.html http://www.thanksmister.com/index.php/archive/firefox-flex-urlrequest-and-sessions-issue/ http://www.forta.com/blog/index.cfm/2006/9/24/flex-and-session-state-management
来源:sina Blog
The FileReference and FileReferenceList classes also do not providemethods for authentication. With servers that require authentication,you can download files with the Flash® Player browserplug-in, but uploading (on all players) and downloading (on thestand-alone
or external player) fails. Listen for FileReference eventsto determine whether operations complete successfully and to handleerrors.
翻译过来就是 FileReference 不支持验证功能。
解决方法
1. 不使用FileReference,而使用form post上传文件。这样和普通的Html页面一样了。
2. 将Session id传到服务器。 如果你使用的Server是TomCat/JSP 可以如下添加SessionID. var request:URLRequest = new URL Request("http://www.[your url].com" ";jsessionid=" _yoursessionid); 3. 不验证Session,而检查上传ID。比如每次上传前,服务器生成一个ID,上传的时候把这个传ID作为URLRequest的参数传过去。
4. 将需要验证的用户名密码,添加至URLRequest的参数,在服务器端进行验证,然后在服务器端,将用户信息存入session,这样,只要flex页面session不变,下次提交请求时,服务器端的session就是保存用户信息的session。
5. 等待adobe发布hotfix.
参考:
http://bbs.airia.cn/FLEX/thread-732-1-1.html http://www.thanksmister.com/index.php/archive/firefox-flex-urlrequest-and-sessions-issue/ http://www.forta.com/blog/index.cfm/2006/9/24/flex-and-session-state-management
来源:sina Blog
相关文章推荐
- Firefox中使用FileReference上传文件的问题:Session丢失
- 解决ssh项目用swfupload上传文件时session丢失问题.
- struts中post方式上传文件,enctype="multipart/form-data",request.getParameter("file") 是null的问题分析
- 对于ASP.net 2.0上传文件后session丢失问题的解决方案
- 解决php uploadify上传文件时session丢失的问题
- commons fileupload 文件上传乱码问题解决方案 + request.getParameter无法得到参数问题
- 解决使用FireFox下Flash上传文件时SESSION丢失的问题(swfupload)
- 遇到问题-----uploadify上传文件ServletFileUpload.isMultipartContent(request)为false
- kindeditor上传文件在SpringMVC中servletFileUpload.parseRequest(request)解析为空获取不到数据问题 .
- 解决文件上传插件Uploadify在火狐浏览器下,Session丢失的问题
- MultipartHttpServletRequest,ajaxFileUpload上传文件,读取文件乱码问题
- $.ajaxFileUpload上传文件出现错误...问题总结
- input type=''file''美化 及 文件上传img src显示问题
- javaWeb开发中关于eclipse等ide重新部署或重启项目等原因造成上传文件丢失问题解决方案
- jquery文件上传插件uploadify在.NET中session丢失的解决方案
- Java 利用SWFUpload多文件上传 session 为空失效,不能验证的问题
- Flex用filereference上传文件firefox下报2038错误
- httpClient4.3 模拟Post提交,模拟Post上传文件并解决服务端使用spingMVC时upload.parseRequest(request)解析不到File,Pos简单抓取页面数据
- Flex与.NET互操作(五):使用FileReference+HttpHandler实现文件上传/下载
- Flash中使用Filereference上传文件的一些注意事项