473,320 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to open a file without the saving option

375 256MB
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
1 1055
Plater
7,872 Expert 4TB
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

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

Similar topics

7
by: Martin | last post by:
Again drawing on the groups experience:- 1. For general file opening and file saving, using VB6, are there any issues with using the FileOpen and FileSave Common Dialog Boxes? 2. Is using the...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
3
by: John Murray | last post by:
Hi, I'm setting up a project management website, and having a bit of trouble. As part of the site, I have been asked to have a javascript dropdown menu that will open several MS Project (mpp)...
4
by: Bishman | last post by:
Hi, Can someone suggest the best technique / method of opening a Word ( or any other ) Document from an SQL BLOB ? I have the process of saving and retrieveing the file from an SQL Binary...
22
by: fniles | last post by:
I have a .CSV file (comma delimited) that I want to open using OLEDB, but I get the error "External table is not in the expected format." If I save the .CSV file to an .XLS file, I can open the...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
4
by: nottarealaddress | last post by:
I'm trying to get my feet wet in VB2005 (our new standard at work after officially stopping new development in VB6 about a month ago). I'm working with a simple sql 2005 table of 50 entries, one...
22
by: Ken Foskey | last post by:
On Thu, 14 Aug 2008 10:09:01 -0700, raylopez99 wrote: The facts of the case above are that the person took a whole application and distributed it after some minor modifications, ie they did not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.