Hey all! Had a doubt - and wanted to check if this is doable before beginning to code.
Can I use Shrine to direct upload an image directly to an external URL (not S3) using a multipart form POST request.
The URL is custom and created already in the app - and one can upload an image to the URL using a multipart form, and by including the necessary parameters as form inputs in the POST request body.
My question is this: Can I automatically upload an image added by a user to this URL via shrine? Without Shrine, I can upload the image to this URL - but it goes from user → to my server → to the URL. I want to go directly from user to the URL - and avoid saving the file twice.
I am thinking using Shrine’s upload endpoint - I should be able to do this. Possible steps:
- Allow user to upload image
- Pass the upload URL to shrine upload endpoint (using JS)
- Upload the image using multipart form POST request. (Using JS)
Just wanted to check if this is doable? Have not used Shrine before. Familiar with Active Storage - but imo ActiveStorage does not allow you to upload an image to a URL using multipart POST requests.
Any feedback on this? Thank you!