1

Well guys i was looking many hours for internet and i couldn't find the answer.

I have an URL with an image like this:

http://maps.google.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&sensor=false

I need to load this image using ajax or another tool and later convert it into a blob to save in my database.

Thanks

0

2 Answers 2

2

Blit the image into a canvas element, generate a dynamic URI from the canvas, decode the URI into bytes, construct a blob, add to a FormData object, and submit with XMLHttpRequest.

See here.

PS - because the image is served from Google, you will need to use a proxy to circumvent "same-origin" security policy, as described in my linked post.

Sign up to request clarification or add additional context in comments.

Comments

1

That is against the Terms of Use.

See this FAQ which addresses your question.

2 Comments

Actually it's only "storing and serving" that's against the terms. OP is simply looking to store, which could be a fair use.
That is only the wording of the FAQ. I believe what I said, that saving it is against the terms, but IANAL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.