JoeGandy / ShareX-Custom-Upload

A little PHP script created for uploading custom sharex files to your own webserver
MIT License
166 stars 50 forks source link

Generated ShareX config file doesn't have correct extension (.sxcu) #96

Closed bokerlol closed 4 years ago

bokerlol commented 4 years ago

Hey all,

When on the gallery page and I choose 'Generate ShareX Custom Uploader File' it does generate a file that works but it does not have the correct extension at the end of it. If I manually add the .sxcu at the end, it works flawlessly. I've tried a few times and the result was the same every time.

I don't believe I made any changes that would affect this but if you need any information let me know. Just wanted to report this as an issue.

Thanks!

bokerlol commented 4 years ago

Just wanted to add that I helped my friend set his Uploader up tonight and he is getting the extension so no idea why mine didn't.

theaquarium commented 4 years ago

That's interesting. I have a theory as to why this could be: the uploader generates the file name based on the page title you set in your config, and if that includes invalid filename characters, that could cause some strange behavior. Would you mind sharing what you have set for page_title or at least the name of the file that gets downloaded? Is the file name cut off in any way?

bokerlol commented 4 years ago

Yeah it is cut off which is another thing I found odd. I have not changed my page_title at all and neither did my friend. Yet his works and mine does not.

Mine cuts off like so: sharex_My

That is all that is shown when I download the config file.

Also just found the issue, it seems to only be happening in Firefox for me which would make sense why my friend didn't have an issue with it. When I download it through Chrome it shows correctly but when downloading through Firefox it attempts to download this: https://i.imgur.com/tfMbWaB.png

theaquarium commented 4 years ago

That's really strange. Firefox probably just has an unusual way of dealing with download names that maybe doesn't support spaces. I'll leave a little PR to just make the file name consistent and safe, since we'll have big problems when someone goes and tries to name their uploader ^@&*!(@:*&$#^;&*/(:!@'"^*(.

theaquarium commented 4 years ago

Also, I just tried downloading the file in Firefox and I can reproduce this bug, so this is definitely an issue.

bokerlol commented 4 years ago

Awesome. Just wanted to add that I changed my page_title to website_name and I got the correct file this time through Firefox. I believe you are right that it doesn't like spaces in the page_title.