question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue uploading a file with non-English filename

See original GitHub issue
var 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jchariotcommented, Oct 20, 2020

Personally I don’t use Postman, but it seems you can easily open a network inspector this way:

Screen Shot 2020-10-19 at 9 19 02 pm

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.

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.

0reactions
jaydensericcommented, Oct 19, 2020

Personally I don’t use Postman, but it seems you can easily open a network inspector this way:

Screen Shot 2020-10-19 at 9 19 02 pm

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found