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

there is no way to upload files using other transport method than built-in method #19

Closed
mikk150 opened this issue Jul 26, 2022 · 3 comments

Comments

@mikk150
Copy link

mikk150 commented Jul 26, 2022

I would like to do everything using Axios, unfortunately oninitupload does not have a way to tell this plugin that upload has finished

perfect way would be that every event should have promise

@cubiclesoft
Copy link
Owner

The documentation says:

  • oninitupload(startupload, fileinfo, queuestarted) - An optional callback function that is called when the user clicks the Upload icon or presses Ctrl + U.
    • startupload(fileinfo, process) - A callback function to call upon completion of initializing the upload or on failure. The 'process' option can be used to tell the callback to process the upload itself or skip it if it was handled in the callback (e.g. creating an empty directory). When 'process' is a string, it is treated as an error message to display to the user.
    • fileinfo - The file information object of the file to initialize for uploading.
    • queuestarted - An integer containing a UNIX timestamp of when the current upload queue was started. Can be useful to pass to a server that can use the value to copy files that are going to be overwritten to a recycling bin folder before the overwrite happens.

Unless I'm missing something, you should be able to call startupload() and pass false for the process parameter after handling the upload via Axios. I knew some people would not want to use the built-in upload handler when I created the widget. You can also pass an error message back to the widget for it to display via the process parameter.

@mikk150
Copy link
Author

mikk150 commented Aug 9, 2022

@cubiclesoft reopen as yes, I can call startupload() and pass false, but now it does not show progress of uploading

@cubiclesoft
Copy link
Owner

When you call startupload() with false, then it is your responsibility to handle the upload including any upload indicators/dialogs/etc. You are telling the widget that you are or have handled everything related to the upload.

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

No branches or pull requests

2 participants