CFHTTP multipart/form-data post charset

Description

When trying to upload file using CFHTTP, the charset=US-ASCII gets added the Content-Type header. Even if we explicitly tell it (setting the charset on cfhttp to UTF-8).
I've added test file with this ticket.
The forum link for this issue( https://dev.lucee.org/t/cfhttp-multipart-form-data-post-charset/2136 )

Environment

None

Attachments

1
  • 06 Apr 2017, 08:23 am

Activity

Igal Sapir 26 October 2017 at 02:44

I see the charset header shows US-ASCII by default, but US-ASCII is a subset of UTF-8 and anyway it looks to me like the file is uploaded in a binary format.

In any event when I upload a UTF-8 file or a UTF-16 file and I save the file on the target side with cffile it works properly, but if I add a "UTF-16BE" for example I get an error trying to save the file even though the uploaded file was saved in that format with BOM.

I removed the charset part from the Content-Type at https://github.com/Lucee/Lucee/commit/8b9b6538d2be6c2c13fe07be7add9e98890f80f9#diff-851f74c78e856568ffa87c9d2cfabc1aR1039

But for now commented out the line that set the charset because it defaults to the WEB-Charset config value (on my system UTF-8) at https://github.com/Lucee/Lucee/commit/8b9b6538d2be6c2c13fe07be7add9e98890f80f9#diff-851f74c78e856568ffa87c9d2cfabc1aL747 and I'm not sure yet how that might affect current systems that worked properly with default US-ASCII.

If we want to set the charset value then we need to uncomment lines 1040/1

Pothys - MitrahSoft 6 April 2017 at 10:38

, I've confirmed this issue, and created test suite for this issue.
Created pull request ( https://github.com/lucee/Lucee/pull/200 )

Fixed

Details

Assignee

Reporter

Priority

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 6 April 2017 at 08:25
Updated 4 April 2018 at 16:05
Resolved 4 April 2018 at 16:05