I was checking Imageresizer S3 Reader2 plugin, and I have the following question.
My app is basically a c# REST API that has a functionality of serving
photos (resized photos).
Would it be possible to use Imageresizer+Amazon S3 with REST API so I can resize
photos in with Imageresizer in c# before serving it and without transferring original photo over network?
You'll have to transfer the original photo from S3 to your server (at least once) in order to resize it. The S3Reader2 plugin does this automatically. If you want to prevent repeat requests, look into SourceDiskCache.
Otherwise, that's exactly how ImageResizer+S3Reader2 functions.
Related
I have some questions about uploading images to cloud storage, I wish someone could help me. I would like answers according to best practices:
Which is better, send the images to my API with all other form information and then send them to the cloud or upload them to the cloud directly via Frontend and separate from other form information?
Do I need to make a request for each image or is it better to upload all images directly?
Backend generates a signed url at which the client uploads the video directly - this requires solid authentication
Depends if the client has a good internet connection or not but batching is usually good
I have images stored in Google Cloud Storage. Whenever my frontend (Swift) requests a certain image I would like to send the image as quickly and efficiently as possible from my backend.
Conveniently, Google Cloud Storage has direct image links for every image.
Is it most efficient to send a multipart/form-data the same way I send an image captured by a user in the front end to the backend? Or is it more efficient to send the URL of the image stored in the cloud where the frontend can proceed to download the image from that URL?
This can indeed be done through a signed URL which provides limited permission and time to make a request. With signed URLs authentication information is contained in their query string, allowing users without credentials to perform specific actions on a resource.
I would like to point out however that Signed URLs can only be used to access resources in Cloud Storage through XML API endpoints.
Since you are using Swift for your frontend I would also like to direct you to explore Google APIs for iOS, such as CocoaPods.
What is the difference between Cloudinary and Carrierwave, and if they're different, how does one complement the other? (I am planning to use these in a Rails 5.0.2 application.)
Cloudinary is a service for storing images and other media files, and accepts various upload parameters, as well as URL parameters for on-the-fly processing.
CarrierWave is a Ruby library for attaching files, which means it will upload given files to a storage backend (filesystem, S3, Google Cloud etc), and write only the file identifier into the record column.
CarrierWave can use Cloudinary as just another storage backend, and utilize Cloudinary's on-the-fly processing and other features, which is useful if you don't want to process images yourself. CarrierWave can also use another storage backend (filesystem, S3, Google Cloud etc), but most of them are just "dumb object storages" without processing capabilities. Similarly, you can use Cloudinary without CarrierWave, but then you need to implement behaviour for attaching uploaded files to database records yourself.
Amazon S3 static website hosting sounds really tempting - simple to use, reliable, and the price is right.
However, everything I've read so far talks about a "static" website. It seems that by static they mean no server-side processing. Sencha framework seems to fit the bill as it's pure JS framework.
Given that all website assets will be on S3 and no server-side processing is required (contact form will submit to a different server), can a fully featured Sencha mobile site live on S3?
I believe it will work for the same reasons you mentioned...and as you say, its very cheap, so there is little risk in giving it a whirl.
I am creating a mobile app through Phonegap as the client and using Rails as the back-end. I am deploying my app to Heroku and am planning to use S3 to store the image files, because that is what is recommended from my various readings online.
I was wondering how could the Rails controller be used to send images back from Ajax requests from Phonegap.
I am not sure how to write the back-end API code to send images to requests.
I also read that using the send_file method without x-send_file enabled will slow down the server because sending the image would block other request until it is done.
Please let me know if you have any insights.
You could use redirects to the S3 assets here, then your browser is just getting the image directly, and not holding up one of your server processes while the browser slowly downloads the images.
If you need to keep your images private you can use the signed URL feature of S3 to only give signed and time limited URL's to the appropriate users. (See my commit to Paperclip: https://github.com/thoughtbot/paperclip/pull/292)