Ejemplo n.º 1
0
    def post(self):
        file1 = self.request.files['file1'][0]
        original_fname = file1['filename']
        extension = os.path.splitext(original_fname)[1]
        fname = ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(6))
        final_filename= fname+extension
        output_file = open("a.apk", 'w')
        output_file.write(file1['body'])
        output_file.close();
	self.finish("渠道名字是" + parser.parseChannel())
Ejemplo n.º 2
0
 def post(self):
     file1 = self.request.files['file1'][0]
     original_fname = file1['filename']
     extension = os.path.splitext(original_fname)[1]
     fname = ''.join(
         random.choice(string.ascii_lowercase + string.digits)
         for x in range(6))
     final_filename = fname + extension
     output_file = open("a.apk", 'w')
     output_file.write(file1['body'])
     output_file.close()
     self.finish("渠道名字是" + parser.parseChannel())
Ejemplo n.º 3
0
    def post(self):
        util.log(self.get_argument("id", default="0"))
        file1 = self.request.files['files[]'][0]
        util.log(file1['filename'])
        outfile = open("a.apk", "w")
        outfile.write(file1['body'])
        outfile.close()

        channel = None
        try:
            channel = parser.parseChannel()
        except:
            traceback.print_exc()

        if channel:
            jo = json.dumps(dict(channel=channel, state=0))
            self.write(str(jo))
        else:
            jo = json.dumps(dict(state=-1))
            self.write(str(jo))
Ejemplo n.º 4
0
    def post(self):
        util.log(self.get_argument("id", default="0"));
        file1 = self.request.files['files[]'][0];
        util.log(file1['filename']);
        outfile = open("a.apk", "w");
        outfile.write(file1['body']);
        outfile.close();

        channel = None;
        try: 
            channel = parser.parseChannel();
        except:
            traceback.print_exc();

        if channel:
            jo = json.dumps(dict(channel=channel, state=0));
            self.write(str(jo));
        else:
            jo = json.dumps(dict(state=-1));
            self.write(str(jo));