コード例 #1
0
    def file_picker(self):

        # get the filename
        filename = QtWidgets.QFileDialog.getOpenFileName(
            self, 'Single File', "/Users/aakaashkapoor/Desktop/toSend", '*')[0]

        # call the the client read
        client.send_file(filename)
コード例 #2
0
    def write_file(self):

        # get the current filename
        filename = self.model.fileName(self.treeView.currentIndex())

        # call the the client read
        client.send_file("directory/" + filename)

        # remove the file
        os.remove("directory/" + filename)
コード例 #3
0
ファイル: app.py プロジェクト: JGX020/picture-search-talk
def space():
    if request.method == 'POST':
        file = request.files['file']
        dygeneratehtml.replace()
		#print lii.append({'imgurl':'','title':'','name':'12.jpg'})
        if file and allowed_file(file.filename):
            file.save(os.path.join(app.config['UPLOADFILE_FOLDER'],file.filename))
        if file and allowed_file(file.filename):
            client.send_file2 ('validate.txt','101.200.167.44')
        if file and allowed_file(file.filename):
            client.send_file ('uploadsfile/'+file.filename,'101.200.167.44')
            return render_template('space.html',hrefadd='ftp://'+request.args.get('fileadd')+'/'+file.filename)        
    if open('temp/tmp.txt').read()=='true' and request.args.get('unicode')=='jgx020':            #advanced
        return render_template('space.html',hrefadd=client.seladdr('jgx020')[3:len(open('temp/tmp2.txt').read())-4])
    else:
        return render_template('404.html')
コード例 #4
0
ファイル: server.py プロジェクト: JGX020/jgx020s
 def handle (self):
         name_len = ord(self.rfile.read(1))
         name = self.rfile.read(name_len)
         print "Get request:%s"%name
         fd = open(name, 'w')
         fa = open('tmp.txt','w')
         cont = self.rfile.read(4096)    
         while cont:
                 fd.write(cont)
                 cont = self.rfile.read(4096)
         if database.seldatabase('users') is None:
                 fa.write('true')
         fa.close()
         for ip in ips:
             client.send_file ('tmp.txt',ip)
         fd.close()
         print "Out :%s"%name
コード例 #5
0
ファイル: task4_1.py プロジェクト: malak33/PythonIntermediate
def upload(filename):
    client.send_file(filename, True)
    public_files = client.list_public()

    return public_files