This question already has an answer here:
- How do I attach files to nodes? 1 answer
I have a remote front-end application under development and I would like to interface with Drupal as a backend service, using the RestWS module to create a RESTful service to my Drupal instance (using JSON as my data format).
I have a node content type of type "article", that has an image field on it called "field_image".
I'm currently trying to figure out the proper way to upload a file to Drupal through the API created by RestWS.
I can retrieve a node with a file attachment via GET to the URL http://www.example.com/node/1.json, which retrieves the contents of node 1, including the information about the uploaded file:
I can also retrieve information specifically about the file attachment, using the FID returned when requesting information about the node, using the url http://www.example.com/file/1.json:
Now, my question:
How specifically do you upload a file using RestWS, so that you create a file resource to then use when creating a node?