firefox中通过flex上传时提示I/O错误 用flex 做了一个文件上传的功能,往同一个url提交上传,ie中可以成功上传,但firefox中总是提示2038 文件I/O错误。把链接拿出来放在form中测试时,IE和FF下都可以成功上传。哪位大侠能解解惑不 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://zhidao.baidu.com/question/150222141这里的排除过了吗 感谢这位朋友的热心帮助,我今天仔细试了下,发现是非IE浏览器中大于100K的文件才出现这个错误,小于100K的可以成功上传。非常奇怪的是我都是上传到同一个链接。。期盼高手解惑 确认问题是flash取不取非IE浏览器http方式传递的cookie值,但不知道如何才能在flash中用post的方法提交cookie值 参考下这个,多是类似的public InputStream getStream(URL url,String post,URL cookieurl){ HttpURLConnection connection; String cookieVal = null; String sessionId = ""; String key=null; if(cookieurl!=null){ try{ connection = (HttpURLConnection)cookieurl.openConnection(); for (int i = 1; (key = connection.getHeaderFieldKey(i)) != null; i++ ) { if (key.equalsIgnoreCase("set-cookie")) { cookieVal = connection.getHeaderField(i); cookieVal = cookieVal.substring(0, cookieVal.indexOf(";")); sessionId = sessionId+cookieVal+";"; } } InputStream in = connection.getInputStream(); System.out.println(sessionId); }catch(MalformedURLException e){ System.out.println("url can't connection"); return null; }catch(IOException e){ System.out.println(e.getMessage()); return null; } } try { connection = (HttpURLConnection)url.openConnection(); //这个要写在Post前,否则会取不到值,原因我不知道 if(cookieurl!=null){ connection.setRequestProperty("Cookie", sessionId); } if(post!=""){ connection.setDoOutput(true); connection.setRequestMethod("POST"); connection.getOutputStream().write(post.getBytes()); connection.getOutputStream().flush(); connection.getOutputStream().close(); } int responseCode = connection.getResponseCode(); int contentLength = connection.getContentLength(); // System.out.println("Content length: "+contentLength); if (responseCode != HttpURLConnection.HTTP_OK ) return(null); InputStream in = connection.getInputStream(); return(in); } catch(Exception e) { // System.out.println(e); // e.printStackTrace(); return(null); } } 谢谢各位了,问题搞定,非IE浏览器下的sid级的cookie传递不过去,通过jsp中转了下。 这么奇怪,难道火狐对sid写入有更多限制或者设置啥的 我遇到的问题是error#2038,选择文件后点确定就报错,不会对服务器端发起请求。 SSH hibernateTemplate问题 在线等待~~~十万火急!每刷新一下页面就自动创建指定数量的链接,请问是什么原因! JSP乱码,我用的是jsp+mysql+tomcat java文件下载问题...急啊! jsp页面提交中文丢失 关于确认域名访问的问题 100分关于下拉菜单的问题!!有难度哦! [error] mod_jk2.handle() No worker for / 200分求发布JSP网站发布的方法! spring2.5 annotation 有关的 空指针异常 jsf2.0表单ID问题 急 急 急! ! ! jsp页面中需要多个步骤完成一项任务,如何实现
public InputStream getStream(URL url,String post,URL cookieurl){
HttpURLConnection connection;
String cookieVal = null;
String sessionId = "";
String key=null;
if(cookieurl!=null){
try{
connection = (HttpURLConnection)cookieurl.openConnection();
for (int i = 1; (key = connection.getHeaderFieldKey(i)) != null; i++ ) {
if (key.equalsIgnoreCase("set-cookie")) {
cookieVal = connection.getHeaderField(i);
cookieVal = cookieVal.substring(0, cookieVal.indexOf(";"));
sessionId = sessionId+cookieVal+";";
}
}
InputStream in = connection.getInputStream();
System.out.println(sessionId);
}catch(MalformedURLException e){
System.out.println("url can't connection");
return null;
}catch(IOException e){
System.out.println(e.getMessage());
return null;
}
}
try {
connection = (HttpURLConnection)url.openConnection();
//这个要写在Post前,否则会取不到值,原因我不知道
if(cookieurl!=null){
connection.setRequestProperty("Cookie", sessionId);
}
if(post!=""){
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.getOutputStream().write(post.getBytes());
connection.getOutputStream().flush();
connection.getOutputStream().close();
}
int responseCode = connection.getResponseCode();
int contentLength = connection.getContentLength();
// System.out.println("Content length: "+contentLength);
if (responseCode != HttpURLConnection.HTTP_OK ) return(null);
InputStream in = connection.getInputStream();
return(in);
}
catch(Exception e) {
// System.out.println(e);
// e.printStackTrace();
return(null);
}
}