aspose file tools*
The moose likes Web Services and the fly likes How to post binary data? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to post binary data?" Watch "How to post binary data?" New topic
Author

How to post binary data?

Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
Is it possible (how to?) upload a binary fle (like a WAR file) for another developer to examine?

Thanks.

-- mike
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
Do you want to do this via a web service, or is an HTML form that connects to a servlet OK?
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
I'm not sure. I was just thinking I'd upload a zip file that another user could access.

Could you explain the difference?

Thanks.

mike
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
If you don't have a preference, then a regular HTML form upload to a web app (instead of a web service that imposes constraints on both client and server) is most likely the way to go. You'd need a servlet to handle the upload on the server, but the Apache FileUpload library makes that pretty easy. Then you'd have to think about how the other user would come to know about the file, and how he could access it.

All this assumes that by "upload" you meant by HTTP - other options like FTP and WebDAV are possible, if the server supports those.
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
I think you're saying I can't just upload a file to JavaRanch for another user to download, right?

I'll post a file on a server and send the user a URL then.

Thanks.

mike

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
I didn't realize you were asking about uploading a file to this site; I thought you were talking about a general problem and solution. But yes, you can't upload a file here - you'll need to put it somewhere else on a publicly accessible server.
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1083
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to post binary data?