Issue uploading a file with non-English filename
See original GitHub issuevar my_graphQL_func = {
type: responseType,
args: {
file_upload: { type : GraphQLUpload, required: true }
},
resolve: async (_, args) => {
...
console.log( args.file_upload )
...
}
I am using GraphQLUpload. Everything works ok, but whenever I upload a file that contains non-English characters in the file’s name, the app seems to . For example, I got a file named “平仮名.pdf”. When I uploaded it in, this is what I got from console.log above:
Promise {
{ filename: 's�\r.pdf',
mimetype: 'application/pdf',
encoding: '7bit',
createReadStream: [Function: createReadStream] } }
So “平仮名.pdf” became “s�\r.pdf” . This occurs with other languages as well. How do I fix this issue?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
javascript - reject if file name contains non english character
i need to show error message if they trying to upload file name contain non english character file. – vijay · if(filename !=...
Read more >File upload with Non English name - PHP - SitePoint Forums
Hi, I have requirement of uploading filenames with urdu and hindi. 1-Files are getting uploaded and showing properly.
Read more >Problem with upload a file with special characters ... - TechNet
I have a problem when a user with contribute permission try to upload a file with special characters, it gives a access denied...
Read more >UnicodeDecodeError when uploading file with non-english ...
For me, this is very serious problem. At this time, I can fix that by doing decode('utf8') and override get_valid_filename manually. But I...
Read more >Uploaded image with non-english characters is named ...
I have set up charsets to UTF-8 in PHP, Apache, MySQL and WordPress configuration files. I think this has something to do with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Upon further inspection. We created another tiny app to test this, and the tiny app could send files with non-English name to the node.js app without any issue. Therefore, Postman (v7.34.0) is at fault here.
Personally I don’t use Postman, but it seems you can easily open a network inspector this way:
It would be good to figure out if the filenames are being sent correctly from the client. If they are not, then we know the problem is on the client.