I wonder if you could take advantage of the template render for django
and create a handler for them?  Maybe not even that is required.  Try
using the fileinput method from python and read the file in order to
write it out.  take a look at this example from <a href="http://
appengine-cookbook.appspot.com/recipe/zipme-download-sources-of-your-
gae-website-as-a-zip-file/?
id=ahJhcHBlbmdpbmUtY29va2Jvb2tyjgELEgtSZWNpcGVJbmRleCI4YWhKaGNIQmxibWRwYm1VdFkyOXZhMkp2YjJ0eUZBc1NDRU5oZEdWbmIzSjVJZ1pRZVhSb2IyNE0MCxIGUmVjaXBlIjlhaEpoY0hCbGJtZHBibVV0WTI5dmEySnZiMnR5RkFzU0NFTmhkR1ZuYjNKNUlnWlFlWFJvYjI0TTgM">
zipme recipe</a>

lass ZipMaker(webapp.RequestHandler):
    def get(self):
        if users.is_current_user_admin():
            folder = os.path.dirname(__file__)
            self.response.headers['Content-Type'] = 'application/zip'
            self.response.headers['Content-Disposition'] = \
                    'attachment; filename="%s.zip"' % os.path.basename
(folder)
            fid=createZip(folder)
            while True:
                buf=fid.read(2048)
                if buf=="": break
                self.response.out.write(buf)
            fid.close()
        else:
            self.response.headers['Content-Type'] = 'text/html'
            self.response.out.write("You must be admin. Try to login
from %s" %
                                    'http://'+self.request.headers
['Host']+users.create_login_url("/zipme"))

--JJ

On Dec 30, 11:22 am, manuelaraoz <manuelar...@gmail.com> wrote:
> Hi there!
>
> I have a question: Can I upload static files so that some users can
> see them but maintaining them hidden for normal web-surfers?
>
> This can be easily done for web pages... but I couldn't figure out how
> to do it with files, for they don't have a Request Handler to tweak.
> I hope the question is clear.
>
> Thanks in advance,
>
> Manuel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to