Closed benjamin79 closed 8 years ago
Did you end up resolving it @benjamin79 ? I'm getting the same issue
@taktran can you give me a sample file?
I just used any image eg, https://www.photobox.co.uk/my/photo/full?photo_id=9213091927
I will look into.
Thanks!
I found the 🐛 - it's when Content-Type
is undefined
, it seems like azure just times out. I found it by displaying Headers1
with erlang:display(Headers1)
above the Response = ...
line (https://github.com/dkataskin/erlazure/blob/master/src/erlazure.erl#L726)
[{"x-ms-date","Tue, 14 Jun 2016 17:27:28 GMT"},{"x-ms-version","2014-02-14"},{"Host","..."},{"Content-Type",undefined},{"Content-Length","390601"},{"x-ms-blob-type","BlockBlob"}]
When, I hard code image/jpeg
for the Content-Type
in the source code, and it worked straight away:
[{"x-ms-date","Tue, 14 Jun 2016 17:29:44 GMT"},{"x-ms-version","2014-02-14"},{"Host","..."},{"Content-Type","image/jpeg"},{"Content-Length","390601"},{"x-ms-blob-type","BlockBlob"}]
Not sure if you can extract the content type from the blob, or you need to pass it in as a parameter.
Thanks for the insight, the code supposed to set content type to "application/octet-stream" if content_type
option is not specified here https://github.com/dkataskin/erlazure/blob/237a7a9c6bc597fe320d693c4a3490b1751dbe81/src/erlazure.erl#L523. I will look if I missed something.
You should be able to set content type to the desired value explicitly by adding {content_type, "your-content-type"}
to the list of options.
https://github.com/dkataskin/erlazure/commit/22ec00544ea94cd432363d5d3e23266c21e9fe7c commit should have fixed the issue @taktran @benjamin79, @taktran thanks for the insight!
Was just about to say undefined
looked like the culprit! Thanks @dkataskin for the speedy response!
Have tried it on my code, and works a charm now. Again, thanks a bunch!
Hi,
thanks for creating erlazure.
I can list and create containers, but even on 1kb files i get time out when i try to upload something.
:erlazure.put_block_blob(pid, 'test', 'x.pdf', File.read!("x.pdf"))
Please help me. I use elixir 1.2.4 with erlang 18.3