Couple of things
1. You will get better responses on this list if you review the posting
guide at. This post is way to vague to get specific answers. So most
people are not going to respond to it.
http://jakarta.apache.org/site/mail.html
2. If I follow the description correctly you are uploading a batch file
to tomcat. Then loading a page with a link to that batch file. Then
you are clicking on the link and it is displaying contents of the batch
file.
If I followed all of the correctly that is exactly what should happen.
If you are clicking on an Http link that posts to a web server that
server is going to try to return the requested resource.
If you need to execute a file locally from Tomcat then you need to use
one of the Java method calls to execute native files. This by the way
is usually a bad idea. Is what ever your batch file is doing really a
process that you can not recreate in java?
If I have misunderstood entirely which seems likely then you may want to
repost the question formated in accordance with the posting guilds lines
listed above. Posts to support forums should always include a detailed
step by step lise of the process that creates the failing, copies of
relevant configuration files(Saying you deleted "some comments" in a
config file does not really help. We need to see it.), and the lines of
code that are believed to be failing.
nick sturm wrote:
ok, I have done the two things on that page:
renamed the serverlet and deleted the comments around the cgi section
of the web.xml config file.
I created a directory (cgi-bin) under root and under WEB-INF neither
of which would execute the batch file when I link to them. it would
just open the batch file.
thanks, sorry I'm very new to this.
-n
On 8/24/05, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
From: Allistair Crossley [mailto:[EMAIL PROTECTED]
Subject: RE: newbie with a short question
First I cause an open/save prompt with
response.addHeader("Content-Disposition", "attachment;
filename=somebat.bat");
Then I use the response.getOutputStream() and stream the bat
file down it. This requires of course that you get an
inputstream to your bat file first. Copy it into your webapp
somewhere and use the servlet context
getRealPath("/bat/mybat.bat") and then i/o API to read it
into an input stream before sending outbound again.
I found that setting content type of
application/msdos-x-batch failed, as did others, just send it
without a content type as a open/save.
I must be missing something; how does the above cause an existing .bat
file on the server to be executed on the server? (That was the original
question.)
For the OP: the CGI doc for Tomcat can be found at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cgi-howto.html
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]