File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes How to specify file Url in applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "How to specify file Url in applet" Watch "How to specify file Url in applet" New topic
Author

How to specify file Url in applet

pankaj patil
Ranch Hand

Joined: Dec 19, 2004
Posts: 98
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.


Regards,
Pankaj Patil
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to specify file Url in applet
 
Similar Threads
read/write files from Tomcat web.xml?
Basic Servlet Problem
Applet not shown in Eclipse internal browser.
Reading a file in a remote server
exception in uploading the file