You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is needed to make Uppy show any progress or to get to the "Done" state.
Solution
Simply add a list of events that are needed to the docs. I mean ya we could also visit the implementation of the TUS uploader but it would be nice to have everything together in one place. Essential events that are needed for custom uploader are
"upload-start" with a list of uppy files
"upload-success" for each successfully uploaded file
"upload-error" for each failed upload
and then the progress events, but those are outlined in the docs 🙏
upload(fileIDs: string[]){// emit the event for progress tracking to uppythis.uppy.emit("upload-start",this.uppy.getFiles())constpromises=fileIDs.map((fileId)=>{constfile=this.uppy.getFile(fileId)returnnewPromise((resolve,rejects)=>{// some upload hookthis.uploadHook(file.data).then((result: any)=>{// event emitting is important for uppy to keep track of the actual progress statethis.uppy.emit("upload-success",file,result)resolve(result)}).catch((err: any)=>{// event emitting is important for uppy to keep track of the actual progress statethis.uppy.emit("upload-error",file,err)rejects(err)})})})returnPromise.all(promises).then(()=>{})// returned promise needs to be Promise<void>}
Alternatives
Just link to the TUS implementation for a "custom" uploader example
The text was updated successfully, but these errors were encountered:
Jeepers. Thanks @MaxAndDev I was stuck all day yesterday with my custom Firebase storage uploader trying to figure out why the UI never showed any progress on the uploads, even though it was doing the uploads. With that event, it now works properly.
Initial checklist
Problem
There is a problem with the documentation when creating custom uploader plugins. It does not outline that this event
is needed to make Uppy show any progress or to get to the "Done" state.
Solution
Simply add a list of events that are needed to the docs. I mean ya we could also visit the implementation of the TUS uploader but it would be nice to have everything together in one place. Essential events that are needed for custom uploader are
"upload-start" with a list of uppy files
"upload-success" for each successfully uploaded file
"upload-error" for each failed upload
and then the progress events, but those are outlined in the docs 🙏
Alternatives
Just link to the TUS implementation for a "custom" uploader example
The text was updated successfully, but these errors were encountered: