Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23276

Flask upload: How to get file name?

$
0
0

A client is sending files with arbitrary names. I am handling the request with the following implementation.

@app.route('/', methods=['GET', 'POST'])  def upload_file():    if request.method == 'POST':     # 'file-name' is the file name here     if 'file-name' not in request.files:        flash('No file part')        return 'no file found'     file = request.files['file-name']

Should I ask another query/path parameter which defines the file name?


Viewing all articles
Browse latest Browse all 23276

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>