0
votes

I'm using this library.

When I run:

b := container.GetBlobReference("bar")
err := b.Copy("foo", nil)

I get:

storage: service returned error: StatusCode=400, ErrorCode=InvalidHeaderValue, ErrorMessage=The value for one of the HTTP headers is not in the correct format. RequestId:66d0164b-001e-0028-2c4f-78a847000000 Time:2017-12-18T22:26:59.9585462Z, RequestInitiated=Mon, 18 Dec 2017 22:26:59 GMT, RequestId=66d0164b-001e-0028-2c4f-78a847000000, API Version=2016-05-31, QueryParameterName=, QueryParameterValue=

File "foo" does exist.

Perhaps the hint is in QueryParameterName and QueryParameterValue having no values.

1
As written, this question is rather unclear. Great that you linked to the library you're using but... you haven't shown all your code. For instance: how you set up the storage client (e.g. how did you initialize container?). We don't know if it's something you did wrong, an issue with the library you're using, or something else. Please edit your question to be more specific. (Note: When editing, do not include your real connection string; just show your code)David Makogon

1 Answers

0
votes

The source to Copy must be absolute:

destBlob := h.client.GetBlobReference(to)
sourceBlob := h.client.GetBlobReference(from)
err := destBlob.Copy(sourceBlob.GetURL(), nil)