-
Improvement
-
Resolution: Fixed
-
Normal
-
None
In /app/api/Files.scala, lots of shared code between:
- upload() - for uploading file directly
- uploadToDataset() - for uploading file to dataset
Both endpoints expect one file with the input key "File" and don't allow one to associate metadata with the file in the same API call.
To primarily reduce the number of calls required for large-scale project file transfers, I will create a utility upload function that takes a request and:
1. If a key such as "File" is provided, upload only that file to preserve compatibility with existing code.
2. If no keys are provided, all files found in the request will be uploaded.
3. In both cases, if there is a JSON text input in the request with a key that matches one of the input filenames, it will be automatically associated with the uploaded file as metadata.
This will allow existing code to work, but open the door for fewer necessary requests going forward.