I am working on a Java program that handles uploading, deleting, listing, etc... of files to an FTP server.
I've noticed that it allows me to upload a file with this name:
Name, Surname1, Surname2, - Description (Remix) [Random Records].mp3
...but then it won't let me delete it, saying the filename contains invalid characters:
java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
I find it strange that it allows me to upload it if it is going to give me problems later. I had thought about renaming the file, but it is a decision that is not up to me.
Is there a way I can handle files with "complicated" names?
It turned out to be my fault: I just had to select the file name going through Postman -> Right Click -> Encode. Even so, in the end I decided to generate a random name of 12 characters for the file and save both names in the database.
Thanks to all for the help!