I am trying to upload a file to a Flask app and use it as a pandas DataFrame, not store it. I have a Flask app with the following endpoint: ```
@app.route('/upload_file/', methods=['POST'])
def upload_file():
afile = request.files['file']
ff = file.read(afile)
print ff
return str(ff)
```
I am trying to use curl to use POST to upload the file using:
```curl -v -F file='/Users/asharma/../cpr_all_platforms.csv' http://127.0.0.1:5000/upload_file/```
I get the following error:
```
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)
> POST /upload_file/ HTTP/1.1
> Host: 127.0.0.1:5000
> User-Agent: curl/7.49.0
> Accept: */*
> Content-Length: 207
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------b313bf20e62c9f7c
>
< HTTP/1.1 100 Continue
* HTTP 1.0, assume close after body
< HTTP/1.0 400 BAD REQUEST
< Content-Type: text/html
< Content-Length: 192
< Server: Werkzeug/0.11.11 Python/2.7.12
< Date: Fri, 17 Feb 2017 19:00:37 GMT
<
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>400 Bad Request</title>
<h1>Bad Request</h1>
<p>The browser (or proxy) sent a request that this server could not understand.</p>
* Closing connection 0
```