Uploading file multiple times with more than maxfileSize is not working. #893

Open
opened 2017-09-27 17:58:39 +00:00 by shrebhatthp · 1 comment
shrebhatthp commented 2017-09-27 17:58:39 +00:00 (Migrated from github.com)

First time method "onWhenAddingFileFailed" is getting called and then does not call next time when same file is uploaded again. here is code which I am using for file upload with ng2 file upload

 const uploadOptions: FileUploaderOptions = {
            allowedMimeType: ['text/plain'],
            maxFileSize: 1024 * 1024 * 100, // 100Mb
            removeAfterUpload: true,
            autoUpload: true
        };
 private initializeUploader(relativeUrl: string): FileUploader {
        const uploadOptions: FileUploaderOptions =  this.getDefaultUploaderOptions();
        const uploader = new FileUploader(uploadOptions);
        uploader.onCompleteItem = this.uploadComplete.bind(this);
        uploader.onWhenAddingFileFailed = (_, filter) => this.uploadFileRejected(filter);
        uploader.onProgressItem = (_, progess) => this.uploadProgress.progress = progess;

        uploader.onAfterAddingFile = item => {
       
            this.uploadProgress.progress = 0;
            this.uploadProgress.inProgress = true;
        };

        return uploader;
    }
First time method "onWhenAddingFileFailed" is getting called and then does not call next time when same file is uploaded again. here is code which I am using for file upload with ng2 file upload ``` const uploadOptions: FileUploaderOptions = { allowedMimeType: ['text/plain'], maxFileSize: 1024 * 1024 * 100, // 100Mb removeAfterUpload: true, autoUpload: true }; private initializeUploader(relativeUrl: string): FileUploader { const uploadOptions: FileUploaderOptions = this.getDefaultUploaderOptions(); const uploader = new FileUploader(uploadOptions); uploader.onCompleteItem = this.uploadComplete.bind(this); uploader.onWhenAddingFileFailed = (_, filter) => this.uploadFileRejected(filter); uploader.onProgressItem = (_, progess) => this.uploadProgress.progress = progess; uploader.onAfterAddingFile = item => { this.uploadProgress.progress = 0; this.uploadProgress.inProgress = true; }; return uploader; } ```
jigarpt commented 2018-01-05 07:20:17 +00:00 (Migrated from github.com)

I am also facing the same issue. File validation is not triggered if I re-upload same file with same name.

For example: If I am uploading file - test.png; validation (onWhenAddingFileFailed) triggers. However, if I re-upload test.png validation do not trigger.

I think it is related to #871 . Not tested it yet. Will update once I test it.

Best regards.

I am also facing the same issue. File validation is not triggered if I re-upload same file with same name. For example: If I am uploading file - test.png; validation (onWhenAddingFileFailed) triggers. However, if I re-upload test.png validation do not trigger. I think it is related to #871 . Not tested it yet. Will update once I test it. Best regards.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#893