implementing download using a url call

tanmay.kansara at tanmay.kansara at
Fri Mar 28 02:34:02 CET 2014

Hey Guys,

here is what I am trying to solve. 

I have a URL -

This URl is out there as an href tag on users website. Is there a way in which I can serve a file(not from my server) while ensuring that the users remain on the third party website. I am currently using this :

myfile = ""
    meta_tag = "<html><head><meta http-equiv='Refresh' Content='1;URL=%s'></head></html>" % myfile
    return HttpResponse(meta_tag, content_type='force-download')

The above works, however the user gets redirected to a blank page. Would downloading and serving the file from my server be a better option? If so, some pointers please.

Do let me know what would be an elegant solution. The file sizes should be about 500kb(stub files).


More information about the Python-list mailing list