473,487 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Save Dialogue

Hi, I've got some questions concerning getting the save dialogue to
popup when a link is clicked on. The particular issue I'm having is
that the file is returned dynamically (via a search) and I need to get
the file name for the save dialogue. I've heard that using ADO streams
keeps it from opening in the browser, and forces the popup for
"Save/Open" - does this work?

The ADO stream that I would like to use in the codebehind is SIMILAR to
this:
Dim FileName
Dim FullFileName
FileName = 'assigned elsewhere from SQL Query datatable
FullFileName = " 'assigned elsewhere from SQL Query datatable
Response.ContentType = "application/x-unknown"
Response.Addheader "Content-Disposition", "attachment;
filename=" &
chr(34) & FileName & chr(34)
Response.Binarywrite GetBinaryFile(FullFileName)
Function GetBinaryFile(ByVal FileSpec)
Const adTypeBinary = 1
Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open()
objStream.Type = adTypeBinary
objStream.LoadFromFile (FileSpec)
GetBinaryFile = objStream.Read()
Set objStream = Nothing
End Function
Now how do I make the TemplateColumn in the ASP.Net portion linked, or
run this particular code? or is there a better way?
My column:
<asp:TemplateColumn
ItemStyle-HorizontalAlign="Center"><ItemTemplate><asp:Image ID="thumb"
runat="server" /></ItemTemplate></asp:TemplateColumn>
Do I use an anchor element? Some DataItem element? I need to get the
filename via the codebehind, so it needs to happen there. The filename,

thumbnails, etc are all grabbed in the DataGrids ItemDataBound
function.
Thanks!
James

Aug 16 '06 #1
0 934

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6770
by: Raymond H. | last post by:
Hello, I tried the line in vb but it open the dialogue box (I'd like not to open this box; I'd like save without viewing a dialogue box). WebBrowser1.ExecWB OLECMDID_SAVEAS,...
2
2968
by: Kit Truong | last post by:
Hello, I have an asp page that produces output from a database. This allows a simple way for the user to save the data to a text file by going to File->Save as... The default save as options...
3
3316
by: Amy | last post by:
Hello all, My aim: To click on a link (or what looks like a link to the user), and rather than the file linked to opening in the browser or what ever, the save dialogue comes up so they can...
8
2970
by: dave | last post by:
Hi there I'm trying to force save as dialogue using this code in download.asp..but when it runs it prompts for download.asp to save or open. code snippet (from aspfaq.com) ...
5
6850
by: kevin | last post by:
Hi, Any help with this would be really appreciated! I'm trying to download a file from a remote server. The access permissions is okay but the problem I'm facing is that the file is getting...
6
13032
by: Thomas Schoch | last post by:
I want to add a combobox to the save file dialog, where the user can choose an additional option. How can this be done in VB.NET? Thomas
0
4068
by: Dave | last post by:
Greetings, Using the string: $pdf->Output("testfile.pdf", I); the "Save As..." dialogue box does not provide the specified filename. The default is the name of the PHP page used to generate...
1
1516
by: jimmyfo | last post by:
Hi, I've got some questions concerning getting the save dialogue to popup when a link is clicked on. The particular issue I'm having is that the file is returned dynamically (via a search) and I...
3
4046
by: Arrowin | last post by:
Hi all Im relatively new at flash, and am needing to make a "demo file" which consists of a photo album. The people viewing the album must then be able to click on an image, and this will bring up a...
0
7105
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7132
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4870
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.