Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'redirected': 0.07; 'pointers': 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; 'url:download': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'guys,': 0.16; 'subject:download': 0.16; 'wrote:': 0.18; 'hey': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'fairly': 0.24; 'cc:2**0': 0.24; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'page.': 0.31; 'serve': 0.31; 'please.': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'fri,': 0.33; 'third': 0.33; 'common': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'so,': 0.37; 'server': 0.38; 'displays': 0.38; 'pm,': 0.38; 'users': 0.40; 'how': 0.40; 'blank': 0.60; 'serving': 0.60; 'tag': 0.61; 'places': 0.64; 'here': 0.66; 'mar': 0.68; 'content,': 0.68; '*and*': 0.84; 'today;': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=tleC3g1sWesA5TKw4Bx8UGOHCZgiAj2YGcoC9g9wWm8=; b=wc69fa0oOw+QEl1JsrLJp+2sm/cqOz/P1JniME4uEbGV7fnAhhWTIyg7HZTgu95SvH Y9ZSHGnejJ8AJ/22zwcLH3GCWM4/WZw59Y9/wcurqJEYiFcMamcWnrOG0iydrXLO+h/F nxXXl3qFF+JB9sO7RdlFS9sjydO46WNeqEHk5pWnLrTfSS+WznxoJktW+d8iDtR8B+0A Gpi4vV0Z3QHZYuOgUwGoUCGNIqL093kdHhoV2AjrDjAEfZhAPAO7VhBTsjIvLR4xPTqj 8P3y46gqnNiAggQA3ciszqMlTO0wil7LI9Ua8HYyOQ7kaDBGxkYT0g7JWFm3a0N/Vfke 8bIw== MIME-Version: 1.0 X-Received: by 10.66.181.70 with SMTP id du6mr5526475pac.23.1395973611620; Thu, 27 Mar 2014 19:26:51 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 Mar 2014 13:26:51 +1100 Subject: Re: implementing download using a url call From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395973614 news.xs4all.nl 2841 [2001:888:2000:d::a6]:42646 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69241 On Fri, Mar 28, 2014 at 12:34 PM, 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 = "" % 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