uploads: allow uploading multiple files from your computer at once.

Allow uploading multiple files from your computer at once.

The maximum limit is 100 files at once. There is still a 50MB size limit
that applies to the whole upload. This limit is at the Nginx level.

The upload widget no longer shows a thumbnail preview of the uploaded
file. This is because there isn't room for it in a multi-file upload,
and because the next page will show a preview anyway after the files are
uploaded.

Direct file uploads are processed synchronously, so they may be slow.

API change: the `POST /uploads` endpoint now expects the param to be
`upload[files][]`, not `upload[file]`.
This commit is contained in:
evazion
2022-02-18 23:08:17 -06:00
parent e37dd3a6d0
commit 202dfe5d87
10 changed files with 79 additions and 51 deletions

View File

@@ -7,7 +7,7 @@ module UploadTestHelper
source = { source: source_or_file_path }
else
file = Rack::Test::UploadedFile.new(Rails.root.join(source_or_file_path))
source = { file: file }
source = { files: { "0" => file } }
end
perform_enqueued_jobs do