• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to specify file Url in applet

 
pankaj patil
Ranch Hand
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recorded the voice on applet and store it in byte array.Now i want to write this in a file on server through applet.When i specify the address as,

String filename ="http://Gphapale:8080/ajit.txt";// location where the file is to be saved
FileOutputStream fileOutS = new FileOutputStream(filename);
I get following Error message:
ERROR : Exception "http:\localhost:8080\sample.txt (The filename, directory name, or volume label syntax is incorrect)" Occured.

Is there any way to specify the filename so that it get store in tomcat root directory.
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FileOutputStream is for use with a filesystem, not the HTTP protocol. You need some more work to move things across the network. The Apache Jakarta project has a class called HttpClient which does multipart form uploads and O'reilly has a multipart handler for the server side. That should get you pointed in the right direction.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic