开发者社区> 问答> 正文

SWFupload到底怎么了啊,求指点? 400 报错

SWFupload到底怎么了啊,求指点? 400 报错

遇到几个问题:SWFUpload.version = "2.5.0 2010-01-15 Beta 2";

1、swfupload+struts2上传,结果从struts2里面的XXFileName中获取的文件名是这样“IMG_20140325_091550.jpg.jpg”,就是多了个扩展名!!!

2、我上次png,gif,bmp,这样的图片,结果会在struts2里面的XXFileName中获取的文件名是这样“IMG_20140325_091550.png.jpg”,“IMG_20140325_091550.gif.jpg”,“IMG_20140325_091550.bmp.jpg”

3、我一上传非图片的文件后就报错:Error generating resized image.Resizing:ERROR #2124

附上部分配置:

var swfu;
window.onload = function () {
swfu = new SWFUpload({
// Backend Settings
upload_url:"/file/upLoad.action;jsessionId"  + "=" + window["sessionId"],
file_post_name:"xx",
// File Upload Settings     
file_size_limit : "10240",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : "5",


// Event Handler Settings - these functions as defined in Handlers.js
// The handlers are not part of SWFUpload but are part of my website and control how
// my website reacts to the SWFUpload events.
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,

// Button Settings
button_image_url : "/images/swfupload/SmallSpyGlassWithTransperancy_17x18.png",
button_placeholder_id : "spanButtonPlaceholder",
button_width: 180,
button_height: 18,
button_text : '<span class="button">浏览 <span class="buttonSmall">(最大10MB)</span></span>',
button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 11pt; }',
button_text_top_padding: 0,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
// Flash Settings
flash_url : "/scripts/swfupload/swfupload.swf",
//flash9_url : "/scripts/swfupload/swfupload_fp9.swf",


custom_settings : {
upload_target : "divFileProgressContainer",
progressTarget : "fsUploadProgress",
thumbnail_height: 400,
thumbnail_width: 400,
thumbnail_quality: 100
},

// Debug Settings
debug: false
});
};

求解啊!

展开
收起
爱吃鱼的程序员 2020-06-05 12:40:35 418 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    SWF在某个ie的某个flash版本会有问题的。自己写了个开源的上传的插件 http://www.twinkling.cn 支持主流浏览器的上传, 当然也支持html5的续传,文件夹上传,拖拽等功能

    ######回复 @hanmrs : hehe######回复 @hanmrs : 哈哈######有点问题######

    换回2.2版本就没这个问题了。。。。。。

    ######

    引用来自“杨某某”的评论

    换回2.2版本就没这个问题了。。。。。。

    搞定
    2020-06-05 12:40:54
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载