title: Flask File upload - Getting only partial file
body: <p>I am trying to upload a CSV file of 60 mb to my application. But when i save the file to server , it only contains partial(25 mb) of total records from the original.
  This issue is occurring only randomly.</p>
  <pre><code>@fileupload.route('/loadfile',methods = ['POST'])
  def store_to_db():
  for _file in request.files.getlist('filelist'):
          name, ext = FileUtil.get_filename_without_ext(_file.filename)#fetching file name and extension
          fd, path = tempfile.mkstemp(suffix=ext, prefix=name)#saving file as temp
          os.write(fd, _file.read())
          try:
              file_upload_service.savefiletodb(path)
          except Exception as e:
              logger.info(str(e))
          os.close(fd)
  </code></pre>
  <p>Uploader side code:</p>
  <pre><code>    data= {}
      url_path = 'localhost:5000/loadfile'
      data['filelist']=open('employe.txt', 'rb')
      resp = requests.post(url=url_path, files=data)
  </code></pre>
  <p>Any idea why its behaving like this ?</p>
  <p>Note:</p>
  <ul>
  <li><p>When i upload through postman, i am not facing any issue.</p>
  </li>
  <li><p>If I upload through code , sometimes I get partial file.</p>
  </li>
  <li><p>file object in log , when upload via postman</p>
  <p>'employee.TXT' ('text/plain')&gt;</p>
  </li>
  <li><p>file object in log , when upload via code</p>
  <p>'employee.TXT' ('None')&gt;</p>
  </li>
  </ul>