Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server to Client Stream or FileWriter error

Status
Not open for further replies.

GGROD

Programmer
Feb 7, 2002
68
US
Is there a way to stream or write a file from a server to client PC?
String filename = "download.txt";
String webPath = "C:\\download\\";

File file = new File(webPath+filename);

FileWriter fileWrite = new FileWriter(file);

String outputString = new String();
outputString += "Text here";
outputString += "and here";

fileWrite.write(outputString);
fileWrite.flush();
fileWrite.close();

I get the following error:
java.io.FileNotFoundException: C:\download\download.txt(The system cannot find the path specified)
 
Using what ? Applets, browsers, RMI, CORBA, Sockets ... the list goes on ...

The (easiest) way is to do it in HTML :
Code:
 <A HREF=&quot;http:[URL unfurl="true"]www.myserver.com/aFile.txt&quot;>[/URL] Download File Here </A>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top