I'm running Drupal 7 with the latest Services Module.

I have a content type that has a file field which accepts unlimited PDF files.

The user will upload the first file (file_full.pdf) that goes up to a directory on the server (/files/private/{NodeID}/pdfs/file_full.pdf).

A script running on the server, monitoring /files/pdfs/ will find the new file and split it into smaller files (file_1-4.pdf, file_5-8.pdf, etc)

We need to get these other PDF files into the node where the file came from so we can pull these files out of the server through our API, so I need to make the script insert these smaller files back into the node where it came from.

Can this be done via the Create File resource? Or should we just try and insert directly into the DB since the script will be running on the server. I just don't know all of the tables required and the data required to create a new file in the DB.

Any ideas how best to accomplish this?

- Jason

Comments

kylebrowning’s picture

Status: Active » Closed (fixed)

Create file has both create_raw and just upload the file in a base64_encode.