Sorry - send you the wrong example. replacd file name with the complete
path. Don't forget to flush.
----- Original Message -----
From: "Foo Shi Hao" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 8:45 AM
Subject: Using JSP to Save file
> Hey all~!
> Got something to ask. I'm running a simple jsp page as shown below. It has
no errors but the file is not being written/created...any ideas?
>
> <%@ page import="java.io.*"%>
> <html>
> <head><title>File Saver</title></head>
> <body>
> <%
> PrintWriter textFile = null;
> try
> {
> textFile = new PrintWriter(new
> FileOutputStream("economic.txt"));
> }
> catch(IOException e)
> {
> System.out.println("File I/O Error.");
> }
> textFile.println("Testing Phase");
> textFile.close();
> %>
> </body>
> </html>
> --
>
> Get your free email from www.doramail.com with 30 Megs of disk space in
webhosting and e-mail storage!
>
>
>
>
>
> Powered by Outblaze