I'm learning python (Flask) I've tried to upload file by flask but it show an error
> PermissionError: [Errno 13] Permission denied: 'C:\Users\Muhammad Usama Javed\Desktop\autotech\static\upload_files'
Here's my code
@app.route('/upload_files', methods=['GET', 'POST'])
def upload_files():
if request.method == 'POST':
if request.files:
# fn.fun_upload_files(request.files['img'])
img = request.files['img']
filename = img.filename
img.save(os.path.join("C:\\Users\\Muhammad Usama Javed\\Desktop\\autotech\\static\\upload_files"), filename)
return redirect('/admin/files')