did something like self.request.FILES["myfile"].name not work? Since uploading files is a fairly common use case, would it be a good idea to get this added to the documentation?
On Mon, Jun 8, 2009 at 3:59 AM, Todd <[email protected]> wrote: > > It took me hours to discover this, and I wanted to share, since I > could not find it anywhere else on the net. > > To get the filename of an uploaded file ( via the Content-Disposition > in the HTTP POST ), use: > > self.request.params[<form element name with file>].filename > > I suppose this may have been obvious to some, but using > self.request.get() always returns the String value of the form > parameter. Appengine overrides the WebOb request to abstract the > cgi.FieldStorage object ( which holds the filename ) from you. > > Hope this helps. > > -Todd > > > -- ======================================= 株式会社ビープラウド イアン・ルイス 〒150-0012 東京都渋谷区広尾1-11-2アイオス広尾ビル604 email: [email protected] TEL:03-5795-2707 FAX:03-5795-2708 http://www.beproud.jp/ ======================================= --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
