feat(ui): permit drag&drop to the operating system
a drop outside of the browser will: - upload the file if only 1 file selected - upload a .zip of the directory or multiple selection (browsers do not permit multiple upload yet) note: I had to create a new handler because a post request to /api/batch/download is possible via JS but it will create a memory blob in the browser, during the drag action. This may exhaust the browser's memory if heavy files This will initiate zip creation from the server even if drop is canceled The best approach is to add a handler supporting GET calls, this call will be triggered by the browser on drop action outside of it's window
This commit is contained in:
@@ -203,7 +203,9 @@ pub fn create_api_routes(app_state: &Arc<AppState>) -> Router<Arc<AppState>> {
|
||||
// Trash operations (soft delete)
|
||||
.route("/trash", post(batch_handler::trash_batch))
|
||||
// Download as ZIP
|
||||
.route("/download", post(batch_handler::download_batch))
|
||||
.route("/download", post(batch_handler::download_batch_post))
|
||||
// work arround for drag & drop (does not support POST requests)
|
||||
.route("/download", get(batch_handler::download_batch_querystring))
|
||||
.with_state(batch_handler_state);
|
||||
|
||||
// Create search routes if the service is available
|
||||
|
||||
Reference in New Issue
Block a user