I have a question about implementing download mechanism for an exe file.
Suppose I have a URL out on the internet like http://mysite.com/test/abc.py. This URL is an an <a href> tag on users websites. I want to code the logic to serve an exe file while keeping the users on the 3rd party website. i came up with following solution:
- Code: Select all
myfile = "http://download.someothersite.com/somefile.exe"
meta_tag = "<html><head><meta http-equiv='Refresh' Content='1;URL=%s'></head></html>" % myfile
return HttpResponse(meta_tag, content_type='force-download')
However, this open a blank page and does serve the file. I do not have the file on my server, Is there a way in which I can I can serve/sernd the file and keep the user on the 3rd part web page? Or would downloading the exe and serving it from my own server be the only option ?