By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,495 Members | 1,307 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,495 IT Pros & Developers. It's quick & easy.

How to open a file without the saving option

100+
P: 375
Hi

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
  1. string fil = sr.GetString(0);
  2. byte[] nwe = new byte[sr.GetBytes(1, 0, null, 0, int.MaxValue)];
  3. sr.GetBytes(1, 0, nwe, 0, nwe.Length);
  4. string pat = Server.MapPath("files/");
  5. File.WriteAllBytes(pat + fil, nwe);
  6. pdf_frame.Visible = true;
  7. pdf_frame.Attributes.Add("src", "files/"+sr.GetString(0));
regards
cmrhema
Jul 3 '08 #1
Share this Question
Share on Google+
1 Reply


Plater
Expert 5K+
P: 7,872
What ?
You are having people download a file from your web application and you want them to not have to chose to save it?
The only control you have over that is if you set the content-disposition header or not. Otherwise it's entirely in the client's software's hands.
Jul 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.