elixir-google-api
elixir-google-api copied to clipboard
storage upload file with file type
I manage to upload multipart file to storage but the file type isn't set, how can I set the file type?
GoogleApi.Storage.V1.Api.Objects.storage_objects_insert_simple(
Connection.get(),
"my-bucket_id",
"multipart",
%{name:"my-file.xml"},
"path/to/my/file.xml")

You have to put the contentType: "text/xml" in the metadata, so:
GoogleApi.Storage.V1.Api.Objects.storage_objects_insert_simple(
Connection.get(),
"my-bucket_id",
"multipart",
%{name:"my-file.xml", contentType: "text/xml"},
"path/to/my/file.xml")