diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-02-23 20:31:19 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-02-23 20:31:19 +0100 |
| commit | 464991b62e4fa6141449ca0c5980fcf0af3097a6 (patch) | |
| tree | 18e597dc951cbf4605995e3aa1b1f8761449549f /themes/okadmin/public/js/upload.js | |
| parent | 19516de0a43ac5f2b0afc9891bbef09d229ce4e6 (diff) | |
upload files and write to diskv0.3.0
Diffstat (limited to 'themes/okadmin/public/js/upload.js')
| -rw-r--r-- | themes/okadmin/public/js/upload.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/themes/okadmin/public/js/upload.js b/themes/okadmin/public/js/upload.js index d300dac..40c6fa7 100644 --- a/themes/okadmin/public/js/upload.js +++ b/themes/okadmin/public/js/upload.js @@ -34,7 +34,7 @@ OKUpload.prototype.parse = function (url) { if (!url) return; var uploader = this; Parser.parse(url, function (media) { - console.log(url, media); + // console.log(url, media); if (!media) { alert("Not a valid link"); } else if (media.type == "image") { @@ -88,6 +88,12 @@ OKUpload.prototype.upload = function (f) { } field = "audio"; action = this.audioAction; + } else if (f.type.match("application.*") || f.type.match("text.*")) { + if (this.config.fileMaxbytes && f.size > this.config.fileMaxbytes) { + return this.largeFileError(f, this.config.fileMaxbytes); + } + field = "file"; + action = this.fileAction; } else { if (this.config.imageMaxbytes && f.size > this.config.imageMaxbytes) { return this.largeFileError(f, this.config.imageMaxbytes); @@ -136,7 +142,7 @@ OKUpload.prototype.upload = function (f) { console.log("ERROR PARSING JSON"); } } - console.log(arguments, request); + // console.log(arguments, request); } function transferError(data) { console.log("Transfer error"); @@ -148,7 +154,7 @@ OKUpload.prototype.upload = function (f) { console.log("Transfer aborted"); this.loadCount += 1; this.hideUploadBars(); - console.log(arguments); + // console.log(arguments); } request.send(fd); |
