문제

Which js library can I use to upload files from any browser and will allow client-side restriction of the file size

도움이 되었습니까?

해결책 2

Try jquery File Uploader

it has option

maxFileSize

The maximum allowed file size in bytes.

Type: integer Default: undefined Example: 10000000 // 10 MB Note: This option has only an effect for browsers supporting the File API.

But old browsers don't support this feature. And unlikely there are any way to fix it

다른 팁

dropzone.js can. dropzone website their example:

Dropzone.options.myAwesomeDropzone = {
  paramName: "file", // The name that will be used to transfer the file
  maxFilesize: 2, // MB
  accept: function(file, done) {
    if (file.name == "justinbieber.jpg") {
      done("Naha, you don't.");
    }
    else { done(); }
  }
};

Try https://github.com/mailru/FileAPI We using this library in our web projects, works fine in any browsers except android default browser.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top