我在Web开发新的,但我困惑我的概念,所以我有2个问题文件上传到Windows Azure的Blob
1->是我的PDF链接URL“https://hrbcdev.blob.core.windows.net/uploads/UserForms/reportlayout-130334646861135641.pdf”和任何正常的PDF谷歌之间的区别链接“http://www.syncfusion.com/Content/downloads/ebook/Knockoutjs_Succinctly.pdf”,因为我的链接下载PDF,而另一个在浏览器中打开。
2->我使用Windows Azure Blob将PDF文件上传到服务器,但是当我点击这些文件时,它会自动开始下载。但我想打开一个新的选项卡,而不是下载....文件上传过程中是否有任何属性,告诉服务器文件是否可下载。这是我的代码:
[HttpPost]
public virtual ActionResult UploadFile(string kind, int? entityId = null) // optionally receive values specified with Html helper
{
// here we can send in some extra info to be included with the delete url
var statuses = new List<ViewDataUploadFileResult>();
var thumbnailKind = AppConfig.KnownKind(kind);
var uploadLocation = AppConfig.UploadLocation(thumbnailKind);
for (var i = 0; i < Request.Files.Count; i++)
{
var storage = new AzureFileStorage();
var st = storage.StoreFile(x =>
{
x.File = Request.Files[i];
x.Kind = thumbnailKind;
//note how we are adding an additional value to be posted with delete request
//and giving it the same value posted with upload
x.DeleteUrl = Url.Action(MVC.FileUploader.DeleteFile(entityId));
x.StorageDirectory = uploadLocation.Path;
x.UrlPrefix = uploadLocation.Url;
});
statuses.Add(st);
}
var json = new { files = statuses };
return Request.Headers["ACCEPT"].Contains("application/json")
? Json(json)
: (ActionResult)Content(json.ToJson());
}