• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF2016 - FileUpload() - Malformed input or input contains unmappable characters

New Here ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

The FileUpload() and <cffile> method throw an error if you upload files with special characters like "öäu".

Everything is set to UTF-8. With ColdFusion 11 we did not have this problem.

Does anybody has any idea?

Regards

Andy

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 06, 2017 Dec 06, 2017

Someone else may have a better answer for you, but in the meantime, I have some questions that may help us help you.

First, are the special characters in the name? or in the file content?

Second, you can override the name of the file with the DESTINATION attribute on a CFFILE action=”upload” (it may appear to most that the destination names only a folder, but it can be a folder or a folder/filename). If you do that, and name it to a different name (even a temp one), might you then be able to do a

...

Votes

Translate

Translate
Community Expert ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

Someone else may have a better answer for you, but in the meantime, I have some questions that may help us help you.

First, are the special characters in the name? or in the file content?

Second, you can override the name of the file with the DESTINATION attribute on a CFFILE action=”upload” (it may appear to most that the destination names only a folder, but it can be a folder or a folder/filename). If you do that, and name it to a different name (even a temp one), might you then be able to do a cffile action=”rename”? I realize that’s a hack. Just trying to help you narrow where the problem is, if not offer a short-term work-around.

Finally, you seem to be implying that this is a change in CF2016 that is affecting you. If you have the CF11 around still, you may want to start by comparing all the CF Admin settings in your CF11 setup to CF2016. Maybe you had a setting that you forgot to bring forward. Or maybe you put in some JVM argument (in the “java and jvm” page) which influenced the difference you see.

(Even better, if you still have CF11 around, can you confirm 100% that the same file uploaded from the same page to the same action page does work and not get this error? It may be that something “like this” did used to work for you, but perhaps this is just different enough to not work now.)

Again, just trying to help, not antagonize or burden you.

/charlie


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 06, 2017 Dec 06, 2017

Copy link to clipboard

Copied

Dear Charlie,

thanks for your help and the right hint.

We are overriding the filename with a UUID now with the DESTINATION attribute. That solution works perfectly for us.

The JVM arguments and the CF Admin settings are the same. That was the first thing we compared. It seems to be a bug in CF16, I guess.

You saved my day!

Andy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

The use-case you describe works just fine in a test. I created a text file and named it öäu.txt. Then I used the following code to upload it:

<cfif isDefined("form.fieldnames") >

    <cffile action = "upload"

        fileField = "fileContents"

        destination = "c:\uploads"

        nameConflict = "makeunique">

      

<cfelse>

    <form method="post" action="uploadForm.cfm" enctype="multipart/form-data">

        <input name="fileContents" type="file">

        <br>

        <input name="submit" type="submit" value="Upload File">

    </form>

</cfif>

The file was duly uploaded to c:\uploads\öäu.txt.

My system consists of:

ColdFusion 2016, Build 5

Windows 7 Ultimate

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

We are running Cold Fusion 2016 on Linux. Maybe that matters.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

Yes, perhaps an Operating System issue. Try to rename a file on the server to öäu, and see what happens.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 28, 2018 Feb 28, 2018

Copy link to clipboard

Copied

I have a similar issue with files with the Turkish character İ. I am on a windows server with CF2016.

It throws the error message: Illegal char <\"> at index 38: x:x\xxxxxxxxxxxxxxxxx\İ.jpg\"

It seems there is a double quote added at the end. I tested all variables. Always same error wit hthis character.
You can try with a filename İ.jpg for example on a simple <cffile action="upload" >

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

LATEST

Hello, did you fix your Turkish character problem. I have same problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation