I'm using FreeTextBox and would like to save the text in a client file.

C

Cal Who

Is it possible using ASP.Net to download text and save it in a file on the
client?

That is, open a dialog box asking where to save it and the fillename just
like a windows form program.

What is the mechanism to do the download?

I'm using FreeTextBox and would like to save the text on the client.

Is there some sample code that downloads that I can see?

Thanks
 
P

Patrice

You should be able to force a download dialog using :
http://support.microsoft.com/kb/260519/en-us (content-disposition header).

Note thought that the user will freeely choose where and even if the content
should be saved (basically for safety reason only the user can decide if and
where the content should be saved).

As most often, some more details about your overall goal could help (for
example you won"t be able to automatically reload the saved content)
 
C

Cal Who

Patrice said:
You should be able to force a download dialog using :
http://support.microsoft.com/kb/260519/en-us (content-disposition header).

Note thought that the user will freeely choose where and even if the
content should be saved (basically for safety reason only the user can
decide if and where the content should be saved).

As most often, some more details about your overall goal could help (for


After the user has created HTML markup using the FreeTextBox she will
probably want to save it on her machine.
No different than if she was using MS Word.
She could cut and paste into a Notebook file and save it that way, but
that's not convient.
FreeTextBox has a Text propety that returns the characters that need to be
sent for saving on the client.

I've done the code below in the past. I'd love for you to critique that!

But I don't know how to send when I have a string to send.

Thanks for your suggestion.
current.Response.SuppressContent = true;

current.Response.Clear();

current.Response.ContentType = "application/octet-stream";

current.Response.AddHeader("Content-Disposition", "attachment; filename=" +
file.Name);

current.Response.Flush();

current.Response.SuppressContent = false;

current.Response.WriteFile(file.FullName);

current.Response.Flush();
 
C

Cal Who

Mark Rae said:
What did FTB's technical support people tell you when you asked them...?
Not sure why you thought I had asked but the truth is it never occured to me
that they would respond to a user of their free product.

You think they would?

Thanks
 
G

Gregory A. Beamer

Guess when I was at the site I narrowly focused on: did I want it and
if so how to get it and propably didn't even notice that button.

That is very common. Many of the questions answered there will be from
users, but the advice is as sound as posting anywhere else. In other words,
try it out and follow up if it fails, just like posting here.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
C

Cal Who

Gregory A. Beamer said:
That is very common. Many of the questions answered there will be from
users, but the advice is as sound as posting anywhere else. In other
words,
try it out and follow up if it fails, just like posting here.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************

Thanks for the help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top