Problem regarding view text file in browser.

P

pargat singh

Hi Everyone,

I have a log file like 123.log and i want to display this log in
browser.In ASP page at top i have following.

<%Response.Buffer = true;%>
<%Response.Expires = -1%>

Inside page i have

contentType = "text/plain";

Response.AddHeader("Content-Disposition","filename=" & sPath);
Response.AddHeader("pragma","no-cache")
Response.AddHeader ("cache-control","private")

Response.CacheControl = "no-cache" ------> I think this line is
main.

Response.ContentType = contentType
Response.Clear()
Response.BinaryWrite(File); --> File is return from COM in Binary
mode.
Response.Flush

I can have one log per job or multiple logs per job.
E.g 123.log
or
123.log
123.esplog
123.soplog etc

When i click Button View Logs i check if one log open it using code
above or if
multiple log then response.redirect to other page where it list all
logs like

123.log
123.esplog
123.soplog etc
and user click on log and behavior is same as single log(means same
code above).


PROBLEMS WHICH I AM FACING ARE BELOW.

1.WHEN SINGLE LOG LIKE 123.LOG OPEN FINE (NO PROBLEM) BUT IF MULTIPLA
LOG AND CLIECK ON 123.LOG I AM GETTING ERROR SAYING

INTERNET EXPLORER CANNOT DOWNLOAD FILE 123.LOG.
INTERNET EXPLORER WAS NOT ABLE TO OPEN THIS INTERNET SITE.THE
REQUESTED SITE
IS EITHER UNAVAILABLE ORCANNOT BE FOUND.PLEASE TRY AGAIN.

BUT IF I RENAME OTHE FILE LIKE 123_BKP1.ESPLOG AND 123_BKP2.SOPLOG
(BECAUSE BASED ON NAME PROGRAM DETECT IF MULTIPLE LOG OR SINGLE LOG)
IT WILL BE SINGLE LOG CASE AND I OPEN IT .WHY?

2. I CAN OPEN 123.ESPLOG BUT NOT 123.SOPLOG.BOTH FILES ARE SAME ONLY
WITH DIFFERENT EXTENSION.WHY?

CAN NAYONE PLEASE.....TELL ME HOW CAN I FIX THIS .THIS IS VERY URGENT
ISSUE FOR ME.ANY HELP IS MUCH MUCH APPRICATE.

THANKS,

GILL
 

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,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top