如何在Jquery中使用AjaxUpload获取文件大小 [英] How to get File size using AjaxUpload in Jquery

查看:300
本文介绍了如何在Jquery中使用AjaxUpload获取文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已使用Jquery的AjaxUpload上传文件.现在,我想在上传之前检查文件大小.
有人知道如何在Jquery中使用AjaxUpload获取文件大小吗?

非常感谢您的帮助...


问候,
Nagraj Naik

Hi,

I have used AjaxUpload of Jquery to upload the file. Now I want to check file size before uploading it.
Does anybody knows how to get File size using AjaxUpload in Jquery?

Your help is much appreciated...


Regards,
Nagraj Naik

推荐答案

对于HTML5,您可以使用提供的File对象获取此类信息.除此之外,您需要在IE中使用ActiveX.

以下几条线程总结了所有相关内容:
使用jQuery检查文件输入大小 [ jQuery Ajax文件上传 [
With HTML5, you can use the File object provided to get such information. Other than that, you need to use ActiveX in IE.

These couple of threads sums up all about it:
Check file input size with jQuery[^]
jQuery Ajax File Upload[^]


我们没有任何属性可以检查文件AjaxUpload方法中的大小

我的代码就是这样

新的AjaxUpload(control,{
操作:"/wizard/SavePaymentsDocument"名称:附件",
onSubmit:函数(文件,扩展名){
///某事
}

onComplete:函数(文件,响应){
///某事
}


当我们有file,ext,response参数时,是否可以有任何尺寸参数.

问候,
Nagraj Naik
Don''t we have any property to check file size in AjaxUpload method

my code is like this

new AjaxUpload(control, {
action: ''/wizard/SavePaymentsDocument'' name: ''Attachment'',
onSubmit: function (file, ext) {
///something
}

onComplete: function (file, response) {
///something
}


As we have file,ext,response parameter ,can we have any parameter for size.

Regards,
Nagraj Naik


这篇关于如何在Jquery中使用AjaxUpload获取文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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