任何人都可以给jquery / javascript限制没有。在asp.net FileUpload控件中上传的文件?

时间:2023-02-02 03:38:30

I am using asp.net FileUpload control to upload multiple images. I want user will not upload more than 5 images. Can anyone give me solution in jquery/javascript?

我使用asp.net FileUpload控件上传多个图像。我希望用户不会上传超过5张图片。任何人都可以在jquery / javascript中给我解决方案吗?

1 个解决方案

#1


0  

There is an option in jquery FileUpload.

jquery FileUpload中有一个选项。

limitMultiFileUploads

To limit the number of files uploaded with one XHR request, set the following option to an integer greater than 0:

要限制使用一个XHR请求上载的文件数,请将以下选项设置为大于0的整数:

  • Type: integer
  • 类型:整数
  • Default: undefined
  • 默认值:未定义
  • Example: 3
  • 示例:3

Note: This option is ignored, if singleFileUploads is set to true or limitMultiFileUploadSize is set and the browser reports file sizes.

注意:如果将singleFileUploads设置为true或者设置了limitMultiFileUploadSize并且浏览器报告文件大小,则忽略此选项。

https://github.com/blueimp/jQuery-File-Upload/wiki/Options

https://github.com/blueimp/jQuery-File-Upload/wiki/Options

#1


0  

There is an option in jquery FileUpload.

jquery FileUpload中有一个选项。

limitMultiFileUploads

To limit the number of files uploaded with one XHR request, set the following option to an integer greater than 0:

要限制使用一个XHR请求上载的文件数,请将以下选项设置为大于0的整数:

  • Type: integer
  • 类型:整数
  • Default: undefined
  • 默认值:未定义
  • Example: 3
  • 示例:3

Note: This option is ignored, if singleFileUploads is set to true or limitMultiFileUploadSize is set and the browser reports file sizes.

注意:如果将singleFileUploads设置为true或者设置了limitMultiFileUploadSize并且浏览器报告文件大小,则忽略此选项。

https://github.com/blueimp/jQuery-File-Upload/wiki/Options

https://github.com/blueimp/jQuery-File-Upload/wiki/Options