tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <>
Subject RE: newbie with a short question
Date Wed, 24 Aug 2005 16:32:14 GMT

I did this the other day with a bat file.

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.

You'd do this in a servlet.


> -----Original Message-----
> From: nick sturm []
> Sent: 24 August 2005 17:21
> To: Tomcat Users List
> Subject: newbie with a short question
> I am new to any web server, but hopefully this question is 
> easilly answered:
> If I wanted to make a link to execute a .bat file locally on the
> server when a link is pressed, how would I do so?
> I am making a pan/tiltable webcam and hope to use the siple 
> controls shown here:
> my major confusion stems from there not being a cgi directory.  (upon
> first inspection)
> Sorry for my ignorance,
> -n
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

QAS Ltd.
Registered in England: No 2582055
Registered in Australia: No 082 851 474

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message