...
Currently, each file in Synapse must be downloaded individually. This works well for many use cases but there are cases where this leads to performance issues. In order to download a file, a client must first request a pre-signed URL. The file can then be downloaded using a HTTPS GET on the returned pre-signed URL. For large files, the time spent on the actual download far exceeds the time spent getting the URL. For a small file, the request for the pre-signed URL can take as long as the actual file download. This can be a significant bottleneck for some use cases. For example, a user may need to download all of the files from a table entity with one or more file columns. If all of the files are small then the requests for each file's pre-signed URL becomes the bottleneck. Therefore, we propose adding a new asynchronous services to allow users to download multiple files with a single request.
...
If user B were to attempt to directly access a pre-signed URL for the same file using GET /fileHandle/1/url then Synapse would return an unauthorized result (403) even though they are authorized to download it through the association with entityId=123. The reason for this is Synapse cannot does not have the means to lookup the associated object given a file handle id. This is a based on how the file data is stored in Synapse:
- Trivial: Given an object.id and object.type lookup the associated fileHandle.id
- Non-Trivial: Given fileHandle.id lookup the associated object.id and object.type.
We need to change how file data is stored in Synapse to make it trivial to lookup the associated object.id and object.type given a fileHandle.id. Then it would be possible for user B, in the above example, to download the file using GET /filefileHandle/1/url.
Asynchronous Bulk File Download
...