Upload of a document

I have an issue with the document upload in Scriptcase,
I have a form where I can upload documents (varbinary) and I specified a DB column for the File Name as well.

The issue I’m having is when we try to upload a file, for example a .docx, and in its name it has a special character, for example : “ä” or “ü”, as soon as I load the file and press “Save” on the form, it will display a sweetAlert error with the message:

“Document: (upload failed)”

and if I remove the special characters from the file name, it will upload correctly.

I tried on the Event to intercept the filename before update, and swap the special characters with normal ones, but I guess there is a check in place from scriptcase, that as soon as not-allowed characters are present, it will pop the sweetalert with the error, not allowing me to change dynamically the filename.

Our DB allows special characters, and if I upload a file with a normal name, and on the Event: beforeUpdate I do the following :

{fileName} = “äüö”;

This will change the filename before upload and upload it correctly to our DB with those special characters! This makes me thing that it’s scriptcase that is blocking the upload.

Any pointers? Thank you

Maybe your filesystem does not like the special characters.
So check your filesystem. So a 16 bit character set is not an UTF character set.
It works fine on windows here. basically I would choose the same character set in the database AND the filesystem.

I don’t think so, also because if we use a Multi-Upload field in Scriptcase, we can upload files with special char in the name without issues! This only happens when we use a “Single-upload” field, there as soon as we try to upload a document with a name that has special char, we get the error!

That is unexpected. If it were my application I would put a few comment lines in the code (for example dump some text in a file or a database) on a minimal application that shows this error.
Then you can easy debug the generated code.
That way you find the upload code…

could I asky ou an example of the “few comment lines” you would put in the code?

So I can try to debug this and see what is going on

see here: https://www.php.net/manual/en/function.error-log.php

error_log(“Illegal access from the outside detected”, 0);

The error should appear in your error.log (assuming you have error loggin on).