-
1. Re: serving files from c drive/ networked drive :-(((
amar Mar 13, 2003 9:03 PM (in response to amar)I have an implementation of jboss3.0.4_tomcat4.1.12 bundle on a windows m/c. I want to write a servlet to serve different types of files such as doc,txt,pdf,txt that could be residing in different folders on the c drive or may be even a network mapped drive, i.e. there are not inside the jboss directory or the war deployment. I'm unable to find resources resoures to do this.
I also tried doing this:
// Get the request
//String cReq = "d:\\tmp\\" + req.getParameter("REQ");
String cReq = "c:\\" + strLogId;
out.println(cReq);
boolean fileReturned = false;
if (cReq != null) {
File rFile = new File(cReq);
if (rFile.exists()) {
//return the file
//sendPDF(req, response, cReq);
//sendFile(response, cReq);
out.println("file found :-)");
fileReturned = true;
}
}
if (!fileReturned) {
out.println("file not found :-(");
}
I tried it on a known file testFile.txt, but I get, file not found message.
http://146.6.159.41:8080/UTWiredArchive/servlet/proto1?filePk=testFile.txt
Thank You in advance,
Amar.