I use ASP.NET and C# to create file content from binary value
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();
I put this content in an iframe with jquery.
After this an open/save dialog is shown.
How can I force to open the file directly without open/save dialog?
you cannot force open a file on client machine afterdownload, max you can do is open a new window with something like Response.Redirect(“/somePDFFile.pdf”), where somePDFFile.pdf is file on server which client just downloaded