I've a "attachment" model that has:
title: string image: paperclip attribute video: paperclip attribute
I want to let the users to upload an attachment by using xml or something like that, all the actions supports xml
If they call the controller/action (http://example.net/attachments) with a post, right now they could do something like
curl -H "Content-Type: application/xml" -X POST -d "<attachment><title>Nice Picture</title></attachment>" http://example.net/attachments
But I would like to get a way to test that if I upload the file by using curl or anything else, they will be able to upload the file, if they give it the param "image" it will be processed as an image, if they give it the param "video" it will be processed as a video
But I don't have idea how they may call the action with the xml and upload the file, or if I should use another way or what
Thx