ASP - Launching Notepad.exe Client-side

G

Guest

Hi,

I have Googled the internet beyond belief for a solution to this and keep running into obstacles:

I have written an ASP application using our IIS server which retrieves data and displays them in a nice grid. My boss wants the application to create a .txt file of this data when a button is clicked and then open Notepad with this new file so that it can be saved locally on a user's harddrive.

I can create the file itself fine, but trying to launch Notepad client-side with this new .txt file has proven to be an absolute nightmare. It is a nightmare because I've gotten errors such as from "Automation server can't create object" to others that are a constant, annoying road-block to what seems to me ought to be a simple trick.

Bottom line, how do I do the above without getting errors (opening Notepad with the file created)? Again, Notepad is what my boss wants used, so with that I need to know the solution with ASP (not ASP .NET). Thanks!
 
B

Bob Barrows [MVP]

Hi,

I have Googled the internet beyond belief for a solution to this and
keep running into obstacles:

I have written an ASP application using our IIS server which
retrieves data and displays them in a nice grid. My boss wants the
application to create a .txt file of this data when a button is
clicked and then open Notepad with this new file so that it can be
saved locally on a user's harddrive.

I can create the file itself fine, but trying to launch Notepad
client-side with this new .txt file has proven to be an absolute
nightmare. It is a nightmare because I've gotten errors such as from
"Automation server can't create object" to others that are a
constant, annoying road-block to what seems to me ought to be a
simple trick.

Bottom line, how do I do the above without getting errors (opening
Notepad with the file created)? Again, Notepad is what my boss wants
used, so with that I need to know the solution with ASP (not ASP
.NET). Thanks!


Check a client-side scripting newsgroup such as
microsoft.public.scripting.jscript*, but I doubt you will get much help
unless you consider using HTA (hypertext application). Security
restrictions will prevent ordinary browser pages from launching external
applications.


* your question has nothing to do with ASP which is a server-side
technology that simply generates html to be sent to the client
 
D

Dave Anderson

I have written an ASP application using our IIS server which
retrieves data and displays them in a nice grid. My boss wants
the application to create a .txt file of this data when a
button is clicked and then open Notepad with this new file
so that it can be saved locally on a user's harddrive.

Assuming you have an ASP script that outputs the desired text, what happens
if you send content-type "text/plain"?

Response.ContentType = "text/plain"

http://msdn.microsoft.com/library/en-us/iissdk/html/7dfd936a-b985-4e15-a774-269dfcfd053c.asp

It may help to do something with content-disposition, too:

Response.AddHeader("Content-Disposition","attachment;
filename=report.txt")

http://www.ietf.org/rfc/rfc2183.txt
http://support.microsoft.com/kb/q260519/
 

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

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,838
Latest member
KandiceChi

Latest Threads

Top