Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- url='ptenantectdtest.blob.core.windows.net/documentcontainer/0bbc072c-9114-4ff5-9bc7-dbcc86bff54d?sv=2015-12-11&sr=b&sig=0gqc0l8csgO82dTV5NnTidrQV570YwrVOofN4ZSxSo4%3D&st=2019-07-20T12%3A51%3A12Z&se=2019-07-21T13%3A01%3A12Z&sp=r&rscd=attachment%3B%20filename%3D%20%225ca21af9-5b67-45f8-969c-ae571431c665.pdf%22'
- code(unsuccessful attempt):-
- '''python
- from flask import Flask
- from flask import send_file
- app = Flask(__name__)
- @app.route('/', defaults={'path': ''})
- @app.route('/<path:path>')
- def downloadFile(path):
- if path is None:
- self.Error(400)
- try:
- return send_file(path, as_attachment=True)
- except Exception as e:
- self.log.exception(e)
- self.Error(400)
- if __name__ == '__main__':
- app.run(debug=False)
- from flask import Flask
- from flask import send_file
- app = Flask(__name__)
- @app.route('/download')
- def downloadFile ():
- path = 'ptenantectdtest.blob.core.windows.net/documentcontainer/7d9843fd-0a92-4fbc-aa73-06aa074ca26b?sv=2015-12-11&sr=b&sig=TwA4zEdKWGpZO7hzI9FYjn07S8aN0wCOyQUkzCS5x5Y%3D&st=2019-07-18T18%3A18%3A43Z&se=2019-07-19T18%3A28%3A43Z&sp=r&rscd=attachment%3B%20filename%3D%20%22f4d50a94-580e-4093-b8fd-0a6a78b3b1e6.pdf%22'
- return send_file(path, as_attachment=True)
- if __name__ == '__main__':
- app.run(debug=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement