Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using application/json header for file upload (x-ms-blob-type error) #71

Open
jpsear opened this issue Feb 14, 2019 · 2 comments
Open
Assignees
Labels
question Further information is requested

Comments

@jpsear
Copy link

jpsear commented Feb 14, 2019

Which service(blob, file, queue, table) does this issue concern?

File

Which version of the SDK was used?

10.1.0

What's the Node.js/Browser version?

Node: 8.9.4

What problem was encountered?

I'm not sure how to set the x-ms-blob-type header on a file upload. I can't find it documented. I am looking to upload a .graphql file. I think the content type should be application/json, but when I set this, I get the following error:

Code: 'MissingRequiredHeader',
HeaderName: 'x-ms-blob-type'

Steps to reproduce the issue?

await uploadFileToAzureFile(aborter, localFilePath, fileUrl, {
  progress: ev => console.log(ev),
  rangeSize: 4 * 1024 * 1024,
  parallelism: 20,
  fileHTTPHeaders: {
    fileContentType: 'application/json'
  }
})
@jpsear
Copy link
Author

jpsear commented Feb 14, 2019

In fact, I seem to be getting this error just generally now, even when I remove:

  fileHTTPHeaders: {
    fileContentType: 'application/json'
  }

@XiaoningLiu
Copy link
Member

Hi @jpsear

You are using @azure/storage-file, but the error message is returned by Azure Storage Blob endpoint.

Please check your URL to make sure it's pointing to a Azure File service like "youraccount.file.core.windows.net" instead of a Blob endpoint like "youraccount.blob.core.windows.net".

If you want to use Azure Blob Service, then try @azure/storage-blob instead.

@XiaoningLiu XiaoningLiu self-assigned this Feb 15, 2019
@XiaoningLiu XiaoningLiu added the question Further information is requested label Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants