I have a React web application in which I allow users to upload DICOM files to Google Healthcare API. The current implementation is that the files first gets uploaded to my back-end server which uploads them to Healthcare API. I am allowing users to upload a full DICOM study (100MB - 2+GB) which could have anywhere from 1-500+ DICOM files (each usually 50KB-50MB). Our current approach as worked thus far but as we are expanding, it seems insufficient use of my server.
My goal is to allow user to directly upload to Google Cloud Storage bucket from the React app. I want to perform some validation logic before I export it to Google Healthcare API. I have looked into signed urls but since the files being uploaded are medical images I wasn't sure if they would be secure enough. The users don't necessarily have a google account.
What is the best way I can allow user to directly upload a directory to GCS bucket without going through my server? Are there dangers involved with this approach if the user uploaded a virus? Also signed urls are valid for a set amount of time, can I deactivate a signed url as soon the uploads are complete?
I have used Transloadit for a similar use cases in the past and I had a good experience. For your particular case, use: https://transloadit.com/demos/file-exporting/export-to-google-store/.
This would scale on-demand for you and it also allows you to build a pipeline to perform any pre-processing you'd like, such as virus scanning as you were concerned.
Their full list of pre-defined processing services: https://transloadit.com/services/
They have a pretty nice free tier, but based on your concerns, you'd likely need a premium tier.