Ask a Question related to ASP.NET General, Design and Development.
-
John #1
Save or Open
Hi,
I generate a report in a comma delimited file and give it
a name like MyReport.csv . I then set a Hyperlink
control to point tp the file
HyperLink1.text = "Download"
Hyperlink1.NavigateUrl = "MyReport.csv"
When the user clicks the HyperLink I would always like to
see the dialog come up that asks if you want to 'Open' the
file or 'Save' the file to disk.
I get mixed results. If the client has Excel installed
then this dialog does not come up and IE pops the file
into a spread sheet. If Excel is not installed then IE
pops the file up in a text window (same thing happens if I
delete the csv from the folder options).
If I change the file extension to something strange
like .xyz123 then it always comes up with the dialog but
I want the user to have the option to save the file as
csv.
Anyway, is there some way to force this to always come up
with the Open or Save dialog?
Tks,
JOhn
John Guest
-
Save and Open documents
I`m using Illustator CS on a Dell Latitude with windows XP and have some problems. When opening (File - Open) a previously saved file I do not get my... -
Open file, make changes, save file, close, re-open, file contents not changed
I've now run into this several times and it's completely destroyed all of my confidence in Ilustrator CS on Mac. I'm hoping someone can confirm that... -
Force GetUrl to open dialog box "open or save"
I'm triyng to link several buttons to several external 3D .step and .igs files. I needed Flash to open dialog box "Open or save", but what hapens... -
How to get a OPEN/SAVE dialog option window when open Excel from IE browser.
I use the following to open Excel from IE browser, but I don't get a OPEN/SAVE dialog option window. Instead, the Excel opened in the browser... -
Excel open automatically without giving a dialog box option to Open/Save/Cancel using filesys.create
Excel open automatically without giving a dialog box option to Open/Save/Cancel using filesys.createTextFile. How to pop up the dialog box option... -
Trevor Hartman #2
Re: Save or Open
Not that i know of. Users can force the dialog manually by right clicking /
Save Target As. Either that or just zip the file.
-Trevor
"John" <jcronline@dashgroup.com> wrote in message
news:010901c33b2c$46cc9bc0$a101280a@phx.gbl...> Hi,
>
> I generate a report in a comma delimited file and give it
> a name like MyReport.csv . I then set a Hyperlink
> control to point tp the file
>
> HyperLink1.text = "Download"
> Hyperlink1.NavigateUrl = "MyReport.csv"
>
> When the user clicks the HyperLink I would always like to
> see the dialog come up that asks if you want to 'Open' the
> file or 'Save' the file to disk.
>
> I get mixed results. If the client has Excel installed
> then this dialog does not come up and IE pops the file
> into a spread sheet. If Excel is not installed then IE
> pops the file up in a text window (same thing happens if I
> delete the csv from the folder options).
>
> If I change the file extension to something strange
> like .xyz123 then it always comes up with the dialog but
> I want the user to have the option to save the file as
> csv.
>
> Anyway, is there some way to force this to always come up
> with the Open or Save dialog?
>
> Tks,
> JOhn
Trevor Hartman Guest
-
Kevin Spencer #3
Re: Save or Open
Try creating an ASPX page that opens and reads the file, and then sets the
Response.ContentType property to "application/octet-stream" and then
Response.BinaryWrite()s the file to the output stream. Then you can link to
this file, and you should get the desired effect.
HTH,
Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of Little things.
"John" <jcronline@dashgroup.com> wrote in message
news:010901c33b2c$46cc9bc0$a101280a@phx.gbl...> Hi,
>
> I generate a report in a comma delimited file and give it
> a name like MyReport.csv . I then set a Hyperlink
> control to point tp the file
>
> HyperLink1.text = "Download"
> Hyperlink1.NavigateUrl = "MyReport.csv"
>
> When the user clicks the HyperLink I would always like to
> see the dialog come up that asks if you want to 'Open' the
> file or 'Save' the file to disk.
>
> I get mixed results. If the client has Excel installed
> then this dialog does not come up and IE pops the file
> into a spread sheet. If Excel is not installed then IE
> pops the file up in a text window (same thing happens if I
> delete the csv from the folder options).
>
> If I change the file extension to something strange
> like .xyz123 then it always comes up with the dialog but
> I want the user to have the option to save the file as
> csv.
>
> Anyway, is there some way to force this to always come up
> with the Open or Save dialog?
>
> Tks,
> JOhn
Kevin Spencer Guest
-
john #4
Re: Save or Open
Thanks, this seems to work. One small problem, when you
clict 'Open' it repeats the dialog and you need to click
Open a second time. But, much better than before.
they can depending>-----Original Message-----
>It is a tricky problem, most browsers try to do whateveroutput to convince>on the type of file.
>However, it is possible to override the headers of theit.>the browser that it should try and do something else with(button / imagebutton>
>Instead of just a hyperlink url, generate a controlfollowing with the>etc) with an event / postback
>Then within the server side code (OnClick) use the("MyReport.csv"));>Response object.
>
>Response.AppendHeader( "content-disposition", "attachment;
>filename=MyReport.csv");
> Response.WriteFile(Server.MapPathit> Response.End();
>
>Regards,
>Robin
>
>"John" <jcronline@dashgroup.com> wrote in message
>news:010901c33b2c$46cc9bc0$a101280a@phx.gbl...>> Hi,
>>
>> I generate a report in a comma delimited file and giveto>> a name like MyReport.csv . I then set a Hyperlink
>> control to point tp the file
>>
>> HyperLink1.text = "Download"
>> Hyperlink1.NavigateUrl = "MyReport.csv"
>>
>> When the user clicks the HyperLink I would always likethe>> see the dialog come up that asks if you want to 'Open'if I>> file or 'Save' the file to disk.
>>
>> I get mixed results. If the client has Excel installed
>> then this dialog does not come up and IE pops the file
>> into a spread sheet. If Excel is not installed then IE
>> pops the file up in a text window (same thing happensbut>> delete the csv from the folder options).
>>
>> If I change the file extension to something strange
>> like .xyz123 then it always comes up with the dialogup>> I want the user to have the option to save the file as
>> csv.
>>
>> Anyway, is there some way to force this to always come>>> with the Open or Save dialog?
>>
>> Tks,
>> JOhn
>
>.
>john Guest
-
Robin Day #5
Re: Save or Open
Sorry about blank reply!! Ack, itchy fingers!
Strange, check that there are no other Response Redirects or Url links as
part of this control. Also, maybe try clearing the Response object before
adding the new header and writing the file.
In general whenever I find I need to force the use to do a save as (as
below) I usually provide two buttons, one for save, one for open. The save
forces the dialog and the open just does a response.redirect. That way they
never have the need to click the Save button and then try and open it.
"john" <jcronline@dashgroup.com> wrote in message
news:0c3a01c33b55$e112caf0$a001280a@phx.gbl...> Thanks, this seems to work. One small problem, when you
> clict 'Open' it repeats the dialog and you need to click
> Open a second time. But, much better than before.
>> they can depending> >-----Original Message-----
> >It is a tricky problem, most browsers try to do whatever> output to convince> >on the type of file.
> >However, it is possible to override the headers of the> it.> >the browser that it should try and do something else with> (button / imagebutton> >
> >Instead of just a hyperlink url, generate a control> following with the> >etc) with an event / postback
> >Then within the server side code (OnClick) use the> ("MyReport.csv"));> >Response object.
> >
> >Response.AppendHeader( "content-disposition", "attachment;
> >filename=MyReport.csv");
> > Response.WriteFile(Server.MapPath> it> > Response.End();
> >
> >Regards,
> >Robin
> >
> >"John" <jcronline@dashgroup.com> wrote in message
> >news:010901c33b2c$46cc9bc0$a101280a@phx.gbl...> >> Hi,
> >>
> >> I generate a report in a comma delimited file and give> to> >> a name like MyReport.csv . I then set a Hyperlink
> >> control to point tp the file
> >>
> >> HyperLink1.text = "Download"
> >> Hyperlink1.NavigateUrl = "MyReport.csv"
> >>
> >> When the user clicks the HyperLink I would always like> the> >> see the dialog come up that asks if you want to 'Open'> if I> >> file or 'Save' the file to disk.
> >>
> >> I get mixed results. If the client has Excel installed
> >> then this dialog does not come up and IE pops the file
> >> into a spread sheet. If Excel is not installed then IE
> >> pops the file up in a text window (same thing happens> but> >> delete the csv from the folder options).
> >>
> >> If I change the file extension to something strange
> >> like .xyz123 then it always comes up with the dialog> up> >> I want the user to have the option to save the file as
> >> csv.
> >>
> >> Anyway, is there some way to force this to always come> >> >> with the Open or Save dialog?
> >>
> >> Tks,
> >> JOhn
> >
> >.
> >
Robin Day Guest



Reply With Quote

