commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Wang <>
Subject Regarding the FileUpload project, how to get charset info from FileItemStream?
Date Thu, 05 Jun 2008 06:07:16 GMT
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 

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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message