내 앱 엔진 앱에서 클라우드 저장소에 업로드하려고하는데 콘텐츠가 아닌 파일 이름이 계속 업로드됩니다.Google Cloud Storage에 업로드
HTML은 매우 간단하다 :
<form id="uploadbanner" enctype="multipart/form-data" action="/upload">
<input id="fileupload" name="myfile" type="file" />
<input type="submit" value="submit" id="submit" />
</form>
파이썬 요소는 다음과 같이 진행됩니다
class Uploader(webapp2.RequestHandler):
def get(self):
objectname = '%s'%str(uuid.uuid4())
objectpath = '/gs/bucketname/%s' %objectname
upload = self.request.get('myfile')
writable = files.gs.create(filename=objectpath, mime_type='application/octet-stream', acl='public-read')
with files.open(writable, 'a') as f:
f.write(upload)
files.finalize(writable)
self.response.write('done')
내가 f.write(upload)
확실히 잘못 알고 있지만 나는이 교체하기로되어있어 무슨 생각이 없다