Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8107323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:43:58+00:00 2026-06-06T00:43:58+00:00

Using Google App Engine, I am trying to urlfetch a gzip file from a

  • 0

Using Google App Engine, I am trying to urlfetch a gzip file from a URL which contains one csv file.

Ultimately I would like to output the content of the csv file on my webpage.

I have the following code at the moment:

#!/usr/bin/env python
import webapp2

from google.appengine.api import urlfetch

class Test(webapp2.RequestHandler):
  def get(self):
    self.response.headers['Content-Type'] = 'text/plain'
    url = *this_is_my_url*
    test = urlfetch.fetch(url, deadline=25)
    self.response.out.write(test.content)

app = webapp2.WSGIApplication([
  ('/test', Test)
], debug=True)

Rather than printing the contents of the file to screen, it asks me to download them locally. How do I stop this local download and instead print directly to the screen/webpage?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:43:59+00:00Added an answer on June 6, 2026 at 12:43 am

    See if this works.

    #!/usr/bin/env python
    import webapp2
    from google.appengine.api import urlfetch
    import gzip
    import StringIO
    
    class Test(webapp2.RequestHandler):
      def get(self):
        self.response.headers['Content-Type'] = 'text/plain'
        url = *this_is_my_url*
    
        test = urlfetch.fetch(url, deadline=25)
    
    
        f = StringIO.StringIO(test.content)
        c = gzip.GzipFile(fileobj=f)
        content = c.read()
    
        self.response.out.write(content)
    
    app = webapp2.WSGIApplication([
      (r'/', Test)
    ], debug=True)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to fetch URLs using Google App Engine's urlFetch service and implement
I'm using Django templating with Google App Engine. I'm trying unsuccessfully to print out
I am using Google App Engine with the Datastore interface. Whenever I'm trying to
Im trying to use http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/ as inspiration, but I'm having some troubles with the
I am trying to make a simple application using Google App Engine. Below is
i'm trying to make out with web-apps on java using google app engine. i
I'm trying to access an OAuth-protected resource on Google App Engine using a Java/Groovy
I trying to learn web application development. I'm currently using Google App Engine to
i'm trying to connect a desktop application in java to google app engine using
I'm trying to get tipfy working on Google App Engine (GAE). I'm using Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.