title: how to write file in python-flask
body: <p>Is there any special instruction when I am writing a file in a flask environment? I first got "permission denied" error, and then I run the pycharm as administrator, and no error returned, but my file didn't get written(nothing happened!). </p>
  
  <pre><code>@app.route('/')
  def index():
      with open('test.txt', "wb") as test:
          test.write("I wrote in test!")
      return render_template('index.html')
  </code></pre>
  
  <p>I am doing a project that write a music midi file, store in the project directory, then play the midi on the webpage later to the user. But there seems no way that I can create a file in flask. </p>