我試圖以編程方式下載我剛纔保存到Azure的文件存儲中的文件,我得到一個天青FileStorage CloudFile
{"The remote server returned an error: (400) Bad Request."}
當我打電話的DownloadToStream方法。什麼做錯了?
任何幫助將不勝感激。謝謝!
下面是代碼:
var combinedRelativeDirectory = GetCloudDirectory(relativePath);
CloudFile cloudFile = null;
cloudFile = combinedRelativeDirectory.GetFileReference(filename);
var memoryStream = new MemoryStream();
cloudFile.DownloadToStream(memoryStream, AccessCondition.GenerateIfExistsCondition());
memoryStream.Position = 0;
return memoryStream;
您確定該文件是否存在?又名'if(cloudFile.Exists()){..}' –