How to repeat uploading of the same file (after failed server side validation on other form fields) #282

Open
opened 2016-06-30 09:41:30 +00:00 by dj-at-work · 4 comments
dj-at-work commented 2016-06-30 09:41:30 +00:00 (Migrated from github.com)

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?

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?
markkesty commented 2016-12-14 16:05:19 +00:00 (Migrated from github.com)

Did you ever find a solution to this? I have the same issue

Did you ever find a solution to this? I have the same issue
fuitattila commented 2017-01-25 10:53:16 +00:00 (Migrated from github.com)

Dear @TheNightbear, @markkesty,

You should set isUploaded property on FileItem object set to false, afterr unsuccess upload attempt, like below:

uploader.queue[0].isUploaded = false;

Have a nice day!

Dear @TheNightbear, @markkesty, You should set `isUploaded` property on `FileItem` object set to false, afterr unsuccess upload attempt, like below: `uploader.queue[0].isUploaded = false;` Have a nice day!
javascriptsoldier commented 2018-12-04 11:41:48 +00:00 (Migrated from github.com)

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

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
dotnetgik commented 2020-04-08 14:27:11 +00:00 (Migrated from github.com)

How do we mark a particular chunk as not uploaded so that i can retry only that chunk

How do we mark a particular chunk as not uploaded so that i can retry only that chunk
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#282