Issue
I am trying to move an uploaded file to a specific folder in my Windows system and it gives me WindowsError: [Error 5] Access is denied error. The solutions I happen to see for such problems are run python as Administrator from cmd line. I am not sure if that is possible since it's a web app and i am using the default flask server for development purpose and run it from Pycharm.
my code is
@app.route('/test',methods=['POST'])
def test():
import os
if not os.path.exists("history_plugin"):
os.makedirs("test")
f = open('test/abc.txt', 'w+')
f.close()
Solution
I had been running the application directly from Pycharm, which doesn't run it in administrator mode
I tried running it using command prompt as administrator and it worked for me.
Answered By - Jibin Mathew
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.