WindowsError: [Error 5] Access is denied in Flask
<p>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 .</p>

<p>my code is</p>

<pre><code>@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()
</code></pre>

<p>I had been running the application directly from Pycharm, which doesn't run it in administrator mode</p>

<p>I tried running it using command prompt as administrator and it worked for me.</p>

python flask