我使用ASP.NET和C#從二進制值我可以使保存/下載對話框中的選擇打開嗎?
FileStruct currentFile = null;
File file = new File();
currentFile = file.GetFile(FileID, strTableCode);
Response.ContentType = currentFile.ContentType;
Response.OutputStream.Write(currentFile.FileContent, 0, currentFile.FileContent.Length);
Response.AddHeader("content-disposition", string.Format(@"attachment;filename=""{0}""", currentFile.FileName));
Response.Flush();
創建文件內容,我把這個內容在iframe
使用jQuery。 之後顯示打開/保存對話框。 如何在不打開/保存對話框的情況下直接強制打開文件?
它是什麼樣的文件? – 2012-01-03 07:54:25
用戶可以添加無限制類型,如.doc,.docx,.pdf,圖像和其他類型 – Masoomian 2012-01-03 07:58:38