nokonoko / Uguu

Uguu is a simple lightweight temporary file host with support for drop, paste, click and API uploading.
https://uguu.se
GNU General Public License v3.0
834 stars 103 forks source link

Fix link formatting when uploading file on an instance that doesn't use a subdomain #106

Closed Setup2134 closed 2 weeks ago

Setup2134 commented 3 months ago

I am serving files off of the same domain that uguu is on, when i upload a file the link that is given after uploading the file does not work For example https://example.com/lyOvuANh.jpg brings up 404 not found, the link that should be given when uploading a file is https://example.com/files/lyOvuANh.jpg as that one works and is how it is formatted in the example config Is there a way that I can correct it manually? Thank you

nokonoko commented 3 months ago

Just set your FILE_DOMAIN in config.json to example.com/files, then Uguu will add / + filename when returning the link, thus resulting in https://example.com/files/file.jpg.

Specifally this will affect this line in the Upload.php Class file: 'url' => 'https://' . $this->Connector->CONFIG['FILE_DOMAIN'] . '/' . $this->FILE_INFO['FILENAME'],

I've also added this to the documentation for future reference.