Image from Internet to AppEngine BlobStore (Java) - java

I have uploading of pictures in an appengine application. Pictures was saved in blobstore. It uses the html input file.
In addition to that, I want to allow users to save pictures from the internet to the blobstore. If the user have url of a valid picture, I want the picture to be save in blobstore. Is it possible? How to implement this functionality?
e.g. The user will just input url ex. http://domain.com/picture001.jpg then image will be stored in blobstore. Not just the url the picture itself.
Thanks

Use URLFetch to retrieve the image bytes and then use the Files API to write the bytes you fetched to the blobstore.

Related

File system alternatives for image upload/display

I got a web application with a Java backend and React frontend. It allows users to upload and display pictures like in an album setting.
The application fetches data from a MS SQL server containing data about an image and then displays it in react.
The database contains a table with information about the image (filename, extension etc.) but not a BLOB.
I am currently displaying the image in react by creating an url from my local machine.
My question is now, what file system alternatives is there when i want to stop storing the images locally on my windows machine. Is it possible to use Google Drive API or something similar? What about SFTP? Would appreciate free solutions to begin with.
You can use Amazon S3 to store your images. store information about the image like file name, bucket name ,... etc in your database and store the image itself in Amazon S3.
There are also other alternatives to Amazon S3 if you want, like MinIO, which is open source and S3 compatible.

Upload images without convert to string

I need to upload images and i want to show all of images in another page. I have tried to use volley, but it need to encode and decode to show all images. It made my application not responding when i decode all the string of images.
My questions are:
Are there any ways to upload images beside volley?
Are there any ways to upload images using volley without convert them to string (encode)?
Thanks
I implemented it once by positing multi part file using HttpUrlConnection.
Basically you provide the image file input stream, the desired file name and the file's MIME type.
You can access the source code through this link:
https://github.com/MinaSamy/DailySelfie/blob/master/app/src/main/java/bloodstone/dailyselfie/android/utils/PostMultiPart.java

Image resize using app engine java

I want to read a image and re size it using App Engine java.
i am not able to find how to read image from a location and save it in app engine.
can any one help????
You can store uploaded image to blobstore. Read following document to know how to use blobstore.
https://developers.google.com/appengine/docs/java/blobstore/overview
Then you can use image service to scale image:
https://developers.google.com/appengine/docs/java/images/overview

Java Appengine: How to store a transformed image back to blobstore

I'm able to
-Upload an image to the blobstore
-Transform this image (in my case rescale it)
But I don't seem to be able to find out how I can store the transformed image back to Blobstore.
Any ideas?
BR,
As far as I know, this is currently only an experimental feature. You can create a "file" using createNewBlobFile.
Get more information here: Writing Files to the Blobstore (Experimental).

Fetch Image and Save To Google App Engine Using Blob

I have image URLs like http://example.com/someimage.png - how do I fetch that image and save it with Blob? Thanks.
Here's example code from the documentation showing how to write a file to the blobstore. You'll have to use a stream instead of a writer, since a PNG image is binary, and you'll have to set the appropriate content type, but it should show you the way.
And here's the UrlFetch documentation, explaining how to get some available resource on the web, using HTTP.

Categories

Resources