subscribe: [EMAIL PROTECTED] post: [EMAIL PROTECTED]
It looks as though the name used for the file is currently converted to ascii bytes when the disposition header is written:
in o.a.c.h.methods.multipart.FilePart:
/** * Write the disposition header to the output stream * @param out The output stream * @throws IOException If an IO problem occurs * @see Part#sendDispositionHeader(OutputStream) */ protected void sendDispositionHeader(OutputStream out) throws IOException { LOG.trace("enter sendDispositionHeader(OutputStream out)"); super.sendDispositionHeader(out); String filename = this.source.getFileName(); if (filename != null) { out.write(FILE_NAME_BYTES); out.write(QUOTE_BYTES); out.write(HttpConstants.getAsciiBytes(filename)); out.write(QUOTE_BYTES); } }
Is it a requirement that Disposition Header be in ASCII?
-Mark
Stéphane Houle wrote:
Hi everyone,
I'm very sorry to send an email directly to all of you but I saw your emails in the MultipartPostMethod source code in HttpClient 2.0 RC2. Maybe you can or cannot answer to my question, if not, do you know a mailing list or a person how can answer to my question ??
Here's my question:
I'm using MultipartPostMethod to send a file, everything works well but when the filename contains French character like "é", the character is always converted to ?. I though it was the encoding that was setted to US-ASCII or something like that but no, the encoding is setted to ISO-8859-1. I tried all sort to method to send the file:
- set the File object - set the File object with the filename - set a FilePart - set a FilePart with a FilePartSource
Nothing works, here is a little dump of my Part:
FILE: /home/lhoule/dev/ac-httpClient-1.0/fileTest/toté.mp3 PART 0: ISO-8859-1 PART 0: binary PART 0: application/octet-stream PART 0: file PART 0: ----------------314159265358979323846
I don't know what I can do... I try to search the web for a solution or in jakarta website... Nothing... Did you ever have this kind of problem?? Or maybe I don't use the MultipartPostMethod correctly to support French character??
Any clue?
Thank you very much and sorry again to send an email directly to all of you!
Steph
-- Mark Diggory Software Developer Harvard MIT Data Center http://osprey.hmdc.harvard.edu
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]