使用不同的文件ID上传多个文件ajaxFileUpload [英] upload multiple files with ajaxFileUpload with different file ids

查看:152
本文介绍了使用不同的文件ID上传多个文件ajaxFileUpload的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图以相同的形式上传多个文件。多个文件应该在不同的领域。我使用ajaxfileuploader单个文件,并使用MultipartHttpServletRequest接收它。



我使用了

  $ .ajaxFileUpload 

$ b $ url url:'uploadfile',
secureuri:false,
fileElementId:'setup',
dataType:'text',
数据:{id:id},
成功:函数(数据,状态){

if(status =='success'){

return;
} else {
}

},
错误:function(data,status,e){
return alert('错误!上传失败file!');
}
}

我的问题是我有很多文件上传单个请求。例如setup1,setup2,setup3(不同的ID)。如何给ajaxFileUpload多个ID?感谢您的好意



谢谢

解决方案

考虑使用这个用于multiUpload的JQuery插件。
http://hayageek.com/docs/jquery-upload-file.php


I am trying to upload multiple files in the same form. Multiple files should be in different fields. I used ajaxfileuploader for single file and receive it using MultipartHttpServletRequest. And it was successful.

I used

 $.ajaxFileUpload
(
{
        url: 'uploadfile',
        secureuri: false,
        fileElementId:'setup',
        dataType: 'text',
        data: { id: id },
        success: function (data, status) {

            if (status == 'success') {

                return;
            } else {
            }

        },
        error: function (data, status, e) {
            return alert('Error ! Failed to upload file!');
        }
    }
)

But my problem is I have many files to be uploaded by single request. For example setup1,setup2,setup3 (different ids). How to give multiple ids on ajaxFileUpload? Your kind reply is appreciated

Thank you

解决方案

Consider to use this JQuery plugin for multiUpload. http://hayageek.com/docs/jquery-upload-file.php

这篇关于使用不同的文件ID上传多个文件ajaxFileUpload的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆