def get_file_id(filelistno): dom = rootdom try: fileid = dom.getElementsByTagName('file')[int(filelistno)].getElementsByTagName('id')[0].toxml().replace('<id>', '').replace('</id>', '') except: errprint("file might not exsist") return fileid
def get_file_id(filelistno): dom = rootdom try: fileid = dom.getElementsByTagName('file')[int( filelistno)].getElementsByTagName('id')[0].toxml().replace( '<id>', '').replace('</id>', '') except: errprint("file might not exsist") return fileid
def upload(filepath, filename, folderid): infoprint("Uploading...") url = build_url("file", "content", None) payload = {'filename1': filename, 'folder_id': folderid} try: data = {filename: open(filepath, 'r')} except: errprint("File selected is not a file or other error") return r = requests.post(url=url, data=payload, headers=headers, files=data, proxies=proxies)
def get_all_file_id(): dom = rootdom cnt = int(dom.getElementsByTagName('total-count')[0].toxml().replace('<total-count>', '').replace('</total-count>', '')) fileid={} i=0 while i<=cnt: try: fileid[i] = dom.getElementsByTagName('file')[i].getElementsByTagName('id')[0].toxml().replace('<id>', '').replace('</id>', '') i=i+1 except: errprint("file might not exist") i=cnt+5 return fileid
def get_all_file_id(): dom = rootdom cnt = int( dom.getElementsByTagName('total-count')[0].toxml().replace( '<total-count>', '').replace('</total-count>', '')) fileid = {} i = 0 while i <= cnt: try: fileid[i] = dom.getElementsByTagName( 'file')[i].getElementsByTagName('id')[0].toxml().replace( '<id>', '').replace('</id>', '') i = i + 1 except: errprint("file might not exist") i = cnt + 5 return fileid