I'm moving some existing functionality into a new Drupal site.
- Files are uploaded via posted form
- Their file names are prefixes with UID
- They are then moved to temp holding directory
- A cron job on another server SCPs the files in batches
- The files are verified copied, then deleted via batch ssh command
I'm looking for a clean way to handle (save) an uploaded file coming from a submitted form with an element of type 'file' without "managing" it. I've browsed over file_save_upload()
and like the validation/error handling it offers.
However, I'd rather not have the files exist in the managed file tables. I would need to modify my pulling server's cron job to trigger a managed deletes via web request.
Just as there is a file_save_data()
and analogous file_unmanaged_save_data()
I'm looking for file_unmanaged_save_upload()
. I basically want the first half of file_save_upload()
before it touch the database. It seems like something similar or a workaround should already exist but I haven't found one. I trying to avoid reinventing the wheel.
file_save_upload
. Once the files are copied, update the file location to the new one (or go one step ahead and add a new stream wrapper).