From user-return-21228-apmail-commons-user-archive=commons.apache.org@commons.apache.org Thu Jun 05 06:07:11 2008 Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 13106 invoked from network); 5 Jun 2008 06:07:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jun 2008 06:07:10 -0000 Received: (qmail 29816 invoked by uid 500); 5 Jun 2008 06:07:10 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 29520 invoked by uid 500); 5 Jun 2008 06:07:09 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 29507 invoked by uid 99); 5 Jun 2008 06:07:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jun 2008 23:07:09 -0700 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [60.234.49.2] (HELO kea.bulletinwireless.net) (60.234.49.2) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2008 06:06:20 +0000 Received: from localhost (kea [127.0.0.1]) by kea.bulletinwireless.net (Postfix) with ESMTP id 68A5A17CCD for ; Thu, 5 Jun 2008 18:06:36 +1200 (NZST) X-Virus-Scanned: amavisd-new at bulletinwireless.com X-Spam-Score: -4.243 X-Spam-Level: Received: from kea.bulletinwireless.net ([127.0.0.1]) by localhost (kea.bulletinwireless.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WVUf3wJp4kcA for ; Thu, 5 Jun 2008 18:06:36 +1200 (NZST) Received: from [192.168.1.177] (unknown [192.168.1.177]) (Authenticated sender: jasonw) by kea.bulletinwireless.net (Postfix) with ESMTP id 056F617CC8 for ; Thu, 5 Jun 2008 18:06:36 +1200 (NZST) Message-ID: <48478294.4050200@bulletin.net> Date: Thu, 05 Jun 2008 18:07:16 +1200 From: Jason Wang User-Agent: Thunderbird 2.0.0.14 (X11/20080502) MIME-Version: 1.0 To: user@commons.apache.org Subject: Regarding the FileUpload project, how to get charset info from FileItemStream? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Flag: NO X-Old-Spam-Status: No, score=-4.243 tagged_above=-99 required=10 tests=[ALL_TRUSTED=-1.8, AWL=0.155, BAYES_00=-2.599, WEIRD_PORT=0.001] 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: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org