From 64f41d53728a966f10aef6d7ffbc00853d754300 Mon Sep 17 00:00:00 2001 From: yo mama Date: Fri, 13 Feb 2015 02:41:42 -0800 Subject: fixed some basics --- impattern/im/cgi-bin/imweb/saveImg | 48 -------------------------------------- 1 file changed, 48 deletions(-) delete mode 100755 impattern/im/cgi-bin/imweb/saveImg (limited to 'impattern/im/cgi-bin/imweb/saveImg') diff --git a/impattern/im/cgi-bin/imweb/saveImg b/impattern/im/cgi-bin/imweb/saveImg deleted file mode 100755 index e76c36a..0000000 --- a/impattern/im/cgi-bin/imweb/saveImg +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python - -import hexdirer -import filenamer -import cgi -import fieldstorager -import base64 -import random -import sys -import databaser - -print "Content-type: text/plain" -print "" - -nametag = "imWeb" -#name is the image name - -PARAM_LIST = "name username picture" -form = cgi.FieldStorage() -newvalues = fieldstorager.fieldstorage(PARAM_LIST, form) -thekeys = PARAM_LIST.split() -for key in thekeys: - globals()[key] = newvalues[key] -if username == None: - username = "" -if name == None: - name = str(random.randint(0,100)) -############################################################ -#test here -########################################################### -try: - #the picture is first encoded so we have to decode it - picture = base64.b64decode(picture) - namepart = filenamer.filename(("/"+name+".png"),username,nametag) - filepaths = hexdirer.hexdir() - filepaths = ["",""] - - thefile = filepaths[0]+namepart - f = open(thefile,'w') - for line in picture: - f.write(line) - f.close() - -# databaser.database(filepaths[0],namepart,"imweb capture",username) - print "capture successful" - print filepaths[1]+namepart -except: - print "sorry, there is a problem with image capture" -- cgit v1.2.3-70-g09d2