简体   繁体   English

Azure存储Rest Api文件服务

[英]Azure storage Rest Api File service

I am trying to upload with Http request a file (not a blob) in Azure File service. 我正在尝试使用Http上载Azure文件服务中的文件(不是Blob)。

I have successfully uploaded a blob with Http request. 我已成功上传带有Http请求的Blob。 I am using the same Authentication method (SharedKey). 我正在使用相同的身份验证方法(SharedKey)。 Inside documentation I found that I had to first create and then write a file. 在文档内部,我发现必须先创建然后编写文件。

The Create File operation creates a new file or replaces a file. “创建文件”操作将创建一个新文件或替换一个文件。 Note that calling Create File only initializes the file. 请注意,调用“创建文件”仅会初始化文件。 To add content to a file, call the Put Range operation 要将内容添加到文件,请调用“放置范围”操作

Is it correct. 这是正确的吗。 Does anyone knows any other option. 有谁知道其他任何选择。 It seems a bit wrong to me. 对我来说似乎有点不对劲。 Does anyone has an example in .net? 有人在.net中有示例吗?

(I even tried this workflow but i got a 400 error) (我什至尝试了此工作流程,但出现400错误)

I guess you were expecting the Create File API works like Put Block Blob which uploads the content in the request body. 我猜您在期待Create File API的工作原理类似于Put Block Blob,它可以将内容上传到请求正文中。 Actually Create File is similar to Put Page/Append Blob. 实际上,“创建文件”类似于“放置页面/附加Blob”。 It requires you to initialize the resource first and then update the content. 它要求您先初始化资源,然后再更新内容。 You can refer to the sample that @Michael pointed in the comment. 您可以参考@Michael在评论中指出的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM