I need the curl command to upload a list of files from a form file input field. What I have tried:
curl -b cookies.txt -X POST http://localhost:8081/rt/api/v1.0/add -d '{"title":"Website updated", "description": "Not accessible", "requestor":"[email protected]", "mfiles":["file1.txt","file2.txt"]}' -H 'Content-type:Application/json'
The api to upload the files:
for f in request.files.getlist('mfiles'):
filename = secure_filename(f.filename)
f.save(os.path.join(upload_folder, filename))
This gives me error: Statement is not an insert() expression construct.
What is the exact curl to do so? I am using Flask 0.12, python 2.7
@Boris, Yes. I should have used an input form. And the curl used to upload multiple files is:
curl -b cookies.txt -X POST http://localhost:8081/rt/api/v1.0/add -F "title=some title MM" -F "description=Not accessible" -F "[email protected]" -F "[email protected]" -F "[email protected]"
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments