Re: How to open a text file on the client ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I forgot to answer the last part of your post.

Displaying the log file in the current HTML page is not satisfying as some
logs are made of 35000 lines.

But displaying the log in a new HTML page could be an elegant solution. I'm
going to search how to do that, but if you have some code examples, feel free
to post them here.

Many thanks for the help.

"Hans Kesting" wrote:

Romu expressed precisely :
Dear all,
I'm pretty new to ASP.net even I have some experience with .net.

For my company, I'm developping a build system, this build system is made
from 2 parts :
- a set of powershell scripts
- an asp.net web interface

These 2 parts are located in the same computer.

The scripts deals with the network creating and copying files on a network
share without any problem.

I'm using impersonation for the asp.net to be able to launch the scripts and
this works pretty well. My only problem is when I want to be able to display
the scripts logs on the client side, they are text files and I would like to
be able to open these files, ideally, using the shell extensions (notepad,
...).

The results are displayed on the web page through a TreeView, I tried 2 ways
to do that without success :
- by using the OnSelectedChange event, the value of the TreeNodes is the
file path,
- by using the NavigateUrl property

In both case, nothing happens, my computing environment is XP Pro SP3, IIS
5.1, asp.net 3.5 SP1, and I'm testing with Firefox 3.

Any help would be realy appeciated, really.

Thanks in advance.

I guess those scripts run on the server and you can catch their output
(or wait for the script to finish and pick up the output file).

It is possible to send a file to the browser but you can't
automatically have it processed by the "default application", for
security reasons.

Send a file to the browser and trigger a "save" dialog:
Response.Clear();
Response.ContentType = "text/plain";
Response.AppendHeader("Content-Disposition",
"attachment;filename=log.txt");
Response.WriteFile(locallogfile);
Response.End();

If you want to show the result immediately, why not show it in the
resulting page as part of the HTML? Fill some Label with the text, but
first replace Environment.Newline with "<br/>".

Hans Kesting



.



Relevant Pages

  • Re: PHP scripts under windows without webserver
    ... browser allows you to do something like this. ... you to run scripts without a server. ... html documents used for this will not work if uploaded to the web ...
    (comp.lang.php)
  • Re: Garbled Hugo Award Wikipedia page?
    ... capable of understanding and displaying a web page written a decade ago, ... English has changed, but not such that you can't understand 18C English, ... HTML such that a modern browser will understand older versions of HTML, ...
    (rec.arts.sf.fandom)
  • Re: Goodbye Borland/Inprise/CodeGear and ng denizens
    ... web server, the browser, the client scripts, server scripts, html pages plus ... Mixing HTML with code is a BAD idea. ... It's like putting scripts in a dfm file but that's unfortunately the ...
    (borland.public.delphi.non-technical)
  • Re: is there as simple way to drive html with fortran ?
    ... best is to calculate with fortran and displaying in preparing HTML ... shdocvw.dll to drive Internet browser, I send html from my program and ...
    (comp.lang.fortran)
  • Re: is there as simple way to drive html with fortran ?
    ... best is to calculate with fortran and displaying in preparing HTML ... shdocvw.dll to drive Internet browser, I send html from my program and ...
    (comp.lang.fortran)