I'm using the Services module. I can upload files through web services, but the problem is that all the created files have the same owner, the user account used for the web services. I would like to change this user, but I don't know how to do it.
I have been looking for the functions defined in the file.inc file, but I haven't found a function to change this. How could I change the file's owner?
uid
along during thePOST
to?q=my-endpoint/file.json
?file.inc
has the user id hard coded in, then I think the only way around it is patching thefile.inc
module to listen for yourPOST
user id.hook_entity_presave()
, you can probably use that to set theuid
on the file to data available in the$_POST
array: api.drupal.org/api/drupal/modules!system!system.api.php/…