Download Button /get/xxx/file instead of /xxx/file #263

Closed
opened 2026-01-19 18:29:39 +00:00 by michael · 4 comments
Owner

Originally created by @nachtswirdesdunkel on GitHub.

Clicking on the zip icon the download starts
clicking on the url you get forwarded to a page with a direct download button.
clicking on the download button you again get redirected to the same page instead of downloading the file.
changing the url in the browser from /xxx/file to /get/xxx/file
the download starts as desired.
why not chage the url from the download button into /get/xxx/file ?
i use a selfhosted version on docker behind a proxy

Originally created by @nachtswirdesdunkel on GitHub. Clicking on the zip icon the download starts clicking on the url you get forwarded to a page with a direct download button. clicking on the download button you again get redirected to the same page instead of downloading the file. changing the url in the browser from /xxx/file to /**get**/xxx/file the download starts as desired. why not chage the url from the download button into /get/xxx/file ? i use a selfhosted version on docker behind a proxy
Author
Owner

@paolafrancesca commented on GitHub:

@nachtswirdesdunkel the behaviour for donwload was changed originally (before I became maintainer) to limit some kind of abuse that happened on http://transfer.sh (I don't know the details)
currently opening /xxx/file will show a preview page when opening the link in browser directly or external link. If the referer url path and current path are the same it will be downloaded.
also if the request doesn't contains an Accept: text/html header the download will start (this cover default curl behaviour)

I would not change this behaviour, since it could break a lot of existing third party integration, but for sure we could use /get/xxx/file url in the preview page

@paolafrancesca commented on GitHub: @nachtswirdesdunkel the behaviour for donwload was changed originally (before I became maintainer) to limit some kind of abuse that happened on http://transfer.sh (I don't know the details) currently opening `/xxx/file` will show a preview page when opening the link in browser directly or external link. If the referer url path and current path are the same it will be downloaded. also if the request doesn't contains an `Accept: text/html` header the download will start (this cover default curl behaviour) I would not change this behaviour, since it could break a lot of existing third party integration, but for sure we could use `/get/xxx/file` url in the preview page
Author
Owner

@paolafrancesca commented on GitHub:

the proxy probably doesn't set the referrer, what do you use as proxy?

@paolafrancesca commented on GitHub: the proxy probably doesn't set the referrer, what do you use as proxy?
Author
Owner

@nachtswirdesdunkel commented on GitHub:

ok
i tried it without proxy and the setup works as you decribe.
Therefore the proxy does something disrupting the behaviour.
thanks for the quick reply.

@nachtswirdesdunkel commented on GitHub: ok i tried it without proxy and the setup works as you decribe. Therefore the proxy does something disrupting the behaviour. thanks for the quick reply.
Author
Owner

@nachtswirdesdunkel commented on GitHub:

i use apache proxy
here the conf files

<VirtualHost *:80>
ServerName xxx
RewriteEngine on
RewriteCond %{SERVER_NAME} =xxx
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
ServerName xxx
SSLCertificateFile ...
SSLCertificateKeyFile ...
Include /etc/letsencrypt/options-ssl-apache.conf
 ProxyPreserveHost On
 DocumentRoot /var/www/html
 ProxyPass /.well-known !
 ProxyPass / http://127.0.0.1:8080/
 ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
</IfModule>

and here the docker run

docker run -d \
--name transfer  \
--restart always  \
--publish 8080:8080  \
-v /storage/tmp:/tmp  \
dutchcoders/transfer.sh:latest  \
--provider local  \
--basedir /tmp/
@nachtswirdesdunkel commented on GitHub: i use apache proxy here the conf files ``` <VirtualHost *:80> ServerName xxx RewriteEngine on RewriteCond %{SERVER_NAME} =xxx RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost> <VirtualHost *:443> ServerName xxx SSLCertificateFile ... SSLCertificateKeyFile ... Include /etc/letsencrypt/options-ssl-apache.conf ProxyPreserveHost On DocumentRoot /var/www/html ProxyPass /.well-known ! ProxyPass / http://127.0.0.1:8080/ ProxyPassReverse / http://127.0.0.1:8080/ </VirtualHost> </IfModule> ``` and here the docker run ``` docker run -d \ --name transfer \ --restart always \ --publish 8080:8080 \ -v /storage/tmp:/tmp \ dutchcoders/transfer.sh:latest \ --provider local \ --basedir /tmp/ ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dutchcoders/transfer.sh#263