I want to get a full file path on Flask.
This is part of HTML code.
<form method="post" action="{{ url_for('xxx') }}" enctype='multipart/form-data'>
<dl>
<label for="fname">Filename</label>
<input type="file" name="fname" id="fname">
</dl>
...
</form>
Then, user sends the file name to Flask.
Flask will catch it.
try:
file = request.files['fname']
with open(file.filename) as f:
...
catch:
...
But Flask can only get the filename, not a full path.
So, this application can't open the file and return the Internal Server Error.
How can I get the full path of the user's local file?
Thanks in advance.