How to repeat uploading of the same file (after failed server side validation on other form fields) #282
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I've added additional form data (as described here #241). If the server side validation fails I show an error on the related form field. The user can fix it and repeat the upload of the complete form just by a click on the upload button.
Unfortunately I don't find a way to tell the uploader to upload the current file again. I played around with the FileItem, tried to set isUploaded and isSuccess to false, but nothing works.
Does anyone know how to solve this?
Did you ever find a solution to this? I have the same issue
Dear @TheNightbear, @markkesty,
You should set
isUploadedproperty onFileItemobject set to false, afterr unsuccess upload attempt, like below:uploader.queue[0].isUploaded = false;Have a nice day!
you need to empty the input file value
here the code worked for me
HTML:
<input type="file" name="myfile" #activeFrameinputFile ng2FileSelect [uploader]="frameUploader" (change)="frameUploader.uploadAll()" />component
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core';@ViewChild('activeFrameinputFile') InputFrameVariable: ElementRef;this.frameUploader.onSuccessItem = (item, response, status, headers) => {this.InputFrameVariable.nativeElement.value = '';};this will definitely works
How do we mark a particular chunk as not uploaded so that i can retry only that chunk