Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #69241
| References | <d58f6cea-c290-41f6-8f06-47c317243a8f@googlegroups.com> |
|---|---|
| Date | 2014-03-28 13:26 +1100 |
| Subject | Re: implementing download using a url call |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.8652.1395973614.18130.python-list@python.org> (permalink) |
On Fri, Mar 28, 2014 at 12:34 PM, <tanmay.kansara@gmail.com> wrote: > Hey Guys, > > here is what I am trying to solve. > > I have a URL - somesite.com/server/pattern.x?some_more_stuff > > 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 = "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') > > 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. So what you want is for the user to go to a page which both downloads a file *and* displays content, is that it? This is fairly common on the web today; have a look at how places like Sourceforge do it. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
implementing download using a url call tanmay.kansara@gmail.com - 2014-03-27 18:34 -0700
Re: implementing download using a url call Chris Angelico <rosuav@gmail.com> - 2014-03-28 13:26 +1100
Re: implementing download using a url call tanmay.kansara@gmail.com - 2014-03-28 06:27 -0700
csiph-web