def POST(self, encodedURL): uploadURL = base64.urlsafe_b64decode(str(encodedURL)) x = web.input(up_file={}) filename = x['up_file'].filename type1 = web.input().file_type key, err = fs.putFile(x['up_file'].file, uploadURL) if err != None: web.debug(err) raise web.seeother('/upload') # do something return web.debug(key) ans1, video = infoDBserver.insert_video(key, session.get_user_id()) ans2, video2 = infoDBserver.modify_video(video.videoId,videoName = filename, type = type1) ##waiting for type changing if ans2: raise web.seeother('/edit/'+str(video2.videoId)) else: raise web.seeother('/upload')
def POST(self, encodedURL): uploadURL = base64.urlsafe_b64decode(str(encodedURL)) x = web.input(up_file={}) filename = x['up_file'].filename type1 = web.input().file_type key, err = fs.putFile(x['up_file'].file, uploadURL) if err != None: web.debug(err) raise web.seeother('/upload') # do something return web.debug(key) ans1, video = infoDBserver.insert_video(key, session.get_user_id()) ans2, video2 = infoDBserver.modify_video(video.videoId, videoName=filename, type=type1) ##waiting for type changing if ans2: raise web.seeother('/edit/' + str(video2.videoId)) else: raise web.seeother('/upload')
import sys sys.path.append("../infodbserver") import infoDBserver if __name__=="__main__": # a,b = infoDBserver.insert_notice(12,12,12,"fda",'fda'); a,b = infoDBserver.insert_video("fdas",12); print a