Aspallar / Wiki-Up

Bulk file uploader for MediaWiki sites
GNU General Public License v3.0
11 stars 3 forks source link

Upload Fails when Renaming Files to include Quotation Marks #41

Open Leochan6 opened 1 year ago

Leochan6 commented 1 year ago

When uploading a file that has been renamed before uploading, if the name contains a quotation mark (") it will result in an error saying the name is invalid.

While quotation marks cannot be the original file name on Windows, they are not considered illegal characters in file names on MediaWiki, so renaming them in Wiki-Up directly would be better than having to move or create redirect after upload.

Aspallar commented 1 year ago

Thank you for letting me know, I will look into it as soon as I can

Leochan6 commented 2 months ago

Would this be solved by updating this line in FileUploader.cs from

uploadFormData.Add(new StreamContent(file), "file", uploadFileName);

to

uploadFormData.Add(new StreamContent(file), "file", Uri.EscapeDataString(uploadFileName));