Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. req = requests.post('https://www.otherserver.com/_download_file', data = {'filename':filename})
  2.  
  3. @app.route('/_download_file', methods = ['POST'])
  4. def download_file():
  5. filename = requests.form.get('filename')
  6.  
  7. file_data = codecs.open(filename, 'rb').read()
  8. return file_data
  9.  
  10. with codecs.open(req, 'w') as f:
  11. f.write('new_file.xyz')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement