I have a web service as follows:
/** recieveFileDataSource
* Recieve and save a transmitted file
* @param source
* @return
*/
public void receiveFileDataSource(FileDataSource source)
{
try
{
// Get the name of the file being transmitted
String fileName = source.getName();
// Drop our new file in the tmp directory
File to_file = new File("C:/tmp/" + fileName);
// Get our input and output streams
InputStream from_stream = source.getInputStream();
FileOutputStream to_stream = new FileOutputStream(to_file);
int size = from_stream.available();
int bytes_read;
byte[] data = new byte[size];
while((bytes_read = from_stream.read(data)) != -1)
to_stream.write(data, 0, bytes_read);
from_stream.close();
to_stream.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
...
Which seems okay but on the client side how does one feed this a FileDataSource
object?
Thanks in advance
Tom
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email