views:

80

answers:

1

I am trying to figure out a way where I can create a tab-delimited file containing data from user-defined fields and allow the user to download that file on google app engine.

The sandbox environment that the app runs in does not allow the application to write to disk. Is there another way where I can create a downloadable file?

+6  A: 

Sure there is! You can output your data as csv, for instance. All you need to do is to change the Content-Type header.

It's something like this:

class Test(webapp.RequestHandler):
    def get(self, upload_type):
        self.response.headers['Content-Type'] = 'text/csv'
        self.response.out.write(','.join(['a', 'cool', 'test']))
jbochi