I have saved a file name in sqlserver datatype Binary.
When I open the file from asp.net it opens but it asks for an option Save as, I click that and then it opens too
Once I do this I will set the flag as 1 as somebody has opened it.
Next time when somebody opens it, it should not ask for Save option at all, it should directly Open, Kindly let me know how to do that
I use this code to open it
Expand|Select|Wrap|Line Numbers
- string fil = sr.GetString(0);
- byte[] nwe = new byte[sr.GetBytes(1, 0, null, 0, int.MaxValue)];
- sr.GetBytes(1, 0, nwe, 0, nwe.Length);
- string pat = Server.MapPath("files/");
- File.WriteAllBytes(pat + fil, nwe);
- pdf_frame.Visible = true;
- pdf_frame.Attributes.Add("src", "files/"+sr.GetString(0));
cmrhema