日期:2014-05-16  浏览次数:20352 次

swfupload异常
    在项目中用到了swfupload,win7下开发,完成后部署到linux下,服务器使用tomcat。
    诡异的是一开始使用没问题,过一段时间客户反馈上传图片报错404。
    然后我在本地机器上做验证报错500。
    项目使用SSH框架开发。更诡异的是在我的struts2的action中原本有一个字段保存了值的,但是上传文件到这个action处理的时候这个字段的值变成了null。难道swfupload处理上传文件的时候还会影响action的生命周期?如果一开始就有这问题我也认了,关键是程序已经正常使用了一段时间,本来上传图片是没有问题的,action中的字段也能正常取到值的。
    忘了说一点,报错归报错,实际上图片还是上传成功了。有影响的就两点,一是上传成功不该报错但是报错了,二是字段被清空为null无法使用了。
swfupload调试信息如下:
---SWFUpload Instance Info---
Version: 2.2.0 2009-03-25
Movie Name: SWFUpload_0
Settings:
upload_url:               http://localhost:8080/DreamHouse/dealUpload
flash_url:                swfupload/swfupload.swf?preventswfcaching=1377168738877
use_query_string:         false
requeue_on_error:         false
http_success:             
assume_success_timeout:   0
file_post_name:           Filedata
post_params:              [object Object]
file_types:               *.jpg;*.png;*.gif;*.jpeg
file_types_description:   Image Files
file_size_limit:          200 MB
file_upload_limit:        100
file_queue_limit:         0
debug:                    true
prevent_swf_caching:      true
button_placeholder_id:    spanButtonPlaceHolder
button_placeholder:       Not Set
button_image_url:         /DreamHouse/images/TestImageNoText_65x29.png
button_width:             65
button_height:            29
button_text:              <span class="theFont">浏览</span>
button_text_style:        .theFont { font-size: 16; }
button_text_top_padding:  3
button_text_left_padding: 12
button_action:            -110