Jason Wang wrote:
Hi there,
I just started using the fileupload API to write a REST API a couple
of days ago. Now I run into a problem: I don't know how to get the
charset from uploaded files when using the streaming API.
For example, I can upload files using httpclient library via a
multipart post:
String url = "https://localhost:8040/api/1/sms/out";
PostMethod post = new PostMethod(url);
File smilFile = new File("main.smil");
Part smil = new FilePart(smilFile.getName(),
smilFile,"application/smil","UTF-8"); // the last paramater takes in
the charset.
I noticed that there is a getCharset() method in class DiskFileItem.
Unfortunately, when using the stream api, I should be dealing with the
FileItemStream objects only. Could anyone give any help on this?
Thanks a lot.
Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Problem solved. Found the getHeaders method FileItemStream inherits from
an interface. Sorry to spam you all. I should have been figured it
out before dumping an email to the mail list.
Cheers,
Jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]