(file)
| 770 | } |
| 771 | |
| 772 | addFile(file) { |
| 773 | file.upload = { |
| 774 | uuid: Dropzone.uuidv4(), |
| 775 | progress: 0, |
| 776 | // Setting the total upload size to file.size for the beginning |
| 777 | // It's actual different than the size to be transmitted. |
| 778 | total: file.size, |
| 779 | bytesSent: 0, |
| 780 | filename: this._renameFile(file), |
| 781 | // Not setting chunking information here, because the acutal data — and |
| 782 | // thus the chunks — might change if `options.transformFile` is set |
| 783 | // and does something to the data. |
| 784 | }; |
| 785 | this.files.push(file); |
| 786 | |
| 787 | file.status = Dropzone.ADDED; |
| 788 | |
| 789 | this.emit("addedfile", file); |
| 790 | |
| 791 | this._enqueueThumbnail(file); |
| 792 | |
| 793 | this.accept(file, (error) => { |
| 794 | if (error) { |
| 795 | file.accepted = false; |
| 796 | this._errorProcessing([file], error); // Will set the file.status |
| 797 | } else { |
| 798 | file.accepted = true; |
| 799 | if (this.options.autoQueue) { |
| 800 | this.enqueueFile(file); |
| 801 | } // Will set .accepted = true |
| 802 | } |
| 803 | this._updateMaxFilesReachedClass(); |
| 804 | }); |
| 805 | } |
| 806 | |
| 807 | // Wrapper for enqueueFile |
| 808 | enqueueFiles(files) { |
no test coverage detected