Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark the specified file as a successful upload #1751

Closed
yanwanlun opened this issue Jul 26, 2019 · 4 comments
Closed

Mark the specified file as a successful upload #1751

yanwanlun opened this issue Jul 26, 2019 · 4 comments
Assignees
Labels

Comments

@yanwanlun
Copy link

I will check if the server owns the file before uploading,If it already exists,I want to mark this file as successfully uploaded,No upload is required

@arturi
Copy link
Contributor

arturi commented Jul 29, 2019

Hi! You can do that as I explained in the comment: #1112 (comment), by setting progress.uploadComplete = true:

Object.keys(uppy.state.files).forEach(fileID => {
  // https://uppy.io/docs/uppy/#uppy-setFileState-fileID-state
  uppy.setFileState(fileID, { 
    progress: { uploadComplete: true, uploadStarted: true } 
  })
})

@arturi arturi self-assigned this Jul 29, 2019
@arturi
Copy link
Contributor

arturi commented Aug 1, 2019

You can also create a small custom Uppy plugin that will do the necessary checks before the upload, please see example here: https://uppy.io/docs/writing-plugins/#Example-of-a-custom-plugin.

@ricardopacheco
Copy link

ricardopacheco commented Feb 27, 2020

This change not reflecting in Dashboard Plugin (Button for addFiles hide ou not render).

@aligajani
Copy link

@arturi Thank you, that works. How can we update % of upload progress using the setFileState?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants