1

I want to upload a file. If filename is belong to ASCII charset then it is uploaded successfully, but when filename has Japanese characters in it, then it is not able to upload.

Command used:

  1. curl -X POST -u $username:$pass -F filedata=@/tmp/test_file_20_00.txt https:someURL above command is working fine.

  2. curl -X POST -u $username:$pass -F filedata=@/tmp/test_fileサイト障害対応_20_00.txt https:someURL

above command status is 200, but actually file is not uploaded. Please help. I think problem with Japanese characters in filename.

Sam Protsenko
  • 14,045
  • 4
  • 59
  • 75
  • Is the data in the file the same? Can you copy the data from `/tmp/test_file_20_00.txt` to `/tmp/test_fileサイト障害対応_20_00.txt` and then retry your `curl` command? – Robert Seaman Apr 22 '17 at 19:07
  • No these are two different files. But both having ASCII characters only. The only difference is in there names. – Sohail Ahmed Apr 23 '17 at 09:41
  • But rather than it being the filename, is it possible that it's not working due to the data that's inside? If you copy the data from the file that is working to the file that is not, does it then work? If so, then the data inside `/tmp/test_fileサイト障害対応_20_00.txt` is wrong rather than its filename. – Robert Seaman Apr 23 '17 at 10:53
  • I have tried with same data in both files, but file having Japanese character in its name is not able to upload. – Sohail Ahmed Apr 23 '17 at 17:44
  • I've spun up a quick `Flask` application, and I can see the filename is passed through following this `curl` command. It's possible that the server is unable to handle the characters in the file. Do you own the server? If so, is there anything you can see on the server side? If not, then you will need to modify the filename on the client side before sending it. – Robert Seaman Apr 23 '17 at 18:00
  • What I can do at server end? – Sohail Ahmed Apr 24 '17 at 04:44

0 Answers0