-
java servlet related
Hello,
I am trying to write code for saving a pdf, or other files ( thru a Web page by a client ) . The file are stored on the server side ( in C drive ).
The path for these files are saved in database. I have written a servlet that opens the file in a new window directly. But for now I am working on a same machine ( as client and server). Want to know if this same code will work for real server- client model.
Any help would be of great use.
Thanks.
part of code:
File pdfFile = new File(ab); // ab is the path retrieved from database.
if (pdfFile.exists())
{
if (Desktop.isDesktopSupported())
{
Desktop.getDesktop().open(pdfFile);
} else
{
System.out.println("Awt Desktop is not supported!");
}
} else
{
System.out.println("File is not exists!");
}