{"id":166,"date":"2008-07-17T15:26:00","date_gmt":"2008-07-17T15:26:00","guid":{"rendered":"http:\/\/meier-online.com\/blog\/?p=166"},"modified":"2013-11-29T13:52:14","modified_gmt":"2013-11-29T12:52:14","slug":"dateiupload-mit-der-appengine","status":"publish","type":"post","link":"https:\/\/meier-online.com\/en\/2008\/07\/dateiupload-mit-der-appengine\/","title":{"rendered":"Upload Files with the AppEngine"},"content":{"rendered":"<p>If you want process an uploaded file in a cgi-programm, you often need to juggle with temporary files. How to do it with the Python in the AppEngine? Because you don&#8217;t have write access to a traditonal file system in this highly distrubuted environment. I have searched a while in the documentation. Finally, in an example for picture processing, I found the solution.<\/p>\n<p><!--more-->It was just too easy. If you have a HTML input field of type &#8220;file&#8221; with the name &#8220;Uploadfile&#8221;, you can access the uploaded data like this:<\/p>\n<pre lang=\"python\">filecontent = self.request.get ( 'Uploadfile')<\/pre>\n<p>Then the file content is then stored in the variable &#8220;filecontent&#8221;. If it happens to be a text file, You can process it like a normal string.<\/p>\n<p>For many applications this is  and sufficient and very convenient. A few questions are still open for me:<\/p>\n<ul>\n<li>How to get the original filename?<\/li>\n<li>If the uploaded file is very big, how can I block further processing as early as possible?<\/li>\n<\/ul>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>If you want process an uploaded file in a cgi-programm, you often need to juggle with temporary files. How to do it with the Python in the AppEngine? Because you don&#8217;t have write access to a traditonal file system in this highly distrubuted environment. I have searched a while in the documentation. Finally, in an &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/meier-online.com\/en\/2008\/07\/dateiupload-mit-der-appengine\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Upload Files with the AppEngine&#8221;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[70,194,102,120,98],"class_list":["post-166","post","type-post","status-publish","format-standard","hentry","category-develop","tag-appengine","tag-cloud","tag-dateiupload","tag-file-upload","tag-python","entry"],"_links":{"self":[{"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/posts\/166"}],"collection":[{"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/comments?post=166"}],"version-history":[{"count":8,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/posts\/166\/revisions"}],"predecessor-version":[{"id":1466,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/posts\/166\/revisions\/1466"}],"wp:attachment":[{"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/media?parent=166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/categories?post=166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meier-online.com\/en\/wp-json\/wp\/v2\/tags?post=166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}