uploadify httpError404错误

1.我使用springmvc+uploadify做文件上传,文件上传后页面报Upload Error: 404,但是文件实际上已经上传成功了。可为什么还是404呢?
网上说要绝对路径,但是我写了也没用。这是upload_url: "fileUpdload_uploadFile"。使用debug模式的时候最后显示 uploadError: HTTP ERROR : File ID: SWFUpload_0_1. HTTP Status: 404.

郁闷了一天,网上找各种解决办法都没搞定。 经过测试,用uploadify返回结果要有 
// response.getWriter().write(result);      直接返回流结果。  
 @RequestMapping(value = "/shop/upload",method=RequestMethod.POST)
        public void uploadHandlerForUploadify(HttpServletResponse response,String picHref,HttpServletRequest request)
                throws Exception {
         
            Gson gson = new Gson();  
            String result = gson.toJson(uploadFile);
            String msg = "true";  
            response.getWriter().write(result); 
 
        //  return result;
      }

//如果发货改为。就会出现文件上传成确一直提示Upload Error: 404错误。猜测是uploadify 成功回调函数不能识别响应报文头contentType: application/json;charset=UTF-8为json的标示。
因为uploadify提交的时候没有指定返回数据类型
 @RequestMapping(value = "/shop/upload",method=RequestMethod.POST)
        public stringuploadHandlerForUploadify(HttpServletResponse response,String picHref,HttpServletRequest request)
                throws Exception {
          
            Gson gson = new Gson();  
            String result = gson.toJson(uploadFile);
            
            return result;
      } 


  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值