Wednesday, 11 September 2013

Redmine, upload file with curl

Redmine, upload file with curl

I'm trying to upload files to Redmine from a shell script with curl.
url=localhost/redmine
curl -c cookie -F username=admin -F password=admin $url/login
curl -b cookie -F 'attachments[1][file]'=@file $url/projects/test/files/new
The first curl stores the session cookie into the file cookie after a
successful login. But the second curl to upload always fails. Redmine's
mysterious error message is
ActionController::MethodNotAllowed
Only get requests are allowed.
Any ideas?

No comments:

Post a Comment