OK - that was a very interesting post ... and if it can be done once - it can be done again ๐ it looks like I should only need to create another API specifically for the proof attribute and use that to link the files. I've confirmed that the files do exist in the data/files folder and are referenced in postgres too - I uploaded them to http://localhost:54974/data/upload as a multipart/form-data post so I'm confident they are in there correctly ... they're just not linked to any record - I would have presumed that updating a particular record via a post call would have succeeded in linking the file with the record. I copied the method used in the other post but this just results in more records created, not updated which is perplexing to me and I'm wondering if I'm correctly grasping the components of the payload - to my understanding 0(table_name) at the beginning should signal to create a new record and 823(table_name) should signal to update record id 823 but they both create new records. Am I missing a step like requesting the record first and then posting?
I've tried all combinations of including or excluding the id field in both the API & request body and I either get an error or a new empty record! This would probably be a feature I would use in the future if I can get it working solely through the API but I'm up against the clock in this particular instance and it only needs to happen a couple of times so .... whilst digging through postgres I've noticed that my missing part of the puzzle is in instance_file in a table with the id of my proof field with _record appended to it - I manually added a row to test and hey presto - that existing file is now linked with that record so my plan now is to upload my file data to a temporary relation, do a quick & dirty backend function to cycle through those records and use the data therein to create the necessary links in the instance_file table ๐
TBH - I agree with the other fella on the point that it would be an extremely useful capability for the API have file handling capabilities and (if my methods don't cause any other issues) just for an upload path I don't think it would be a massive amount of work to add to the initial data/upload multipart/form-data request the ability to accept a relation, attribute, & record id (the login id could be garnered from the token and used for checking permissions) then the supplied info can be used to create a record in the appropriate instance_file _record table ... et voila! Maybe something for 3.11 ๐
If I'm not still fighting with this issue by the weekend I may use my Saturday to have a look into the idea further and see if I can get it working at least on a rudimentary level and email you my results with any code changes I make!
Thanks again ๐