Copy files to temporary storage when shared

Is there a way to configure nextcloud such that when a user shares a file, that file gets cached and/or temporarily placed on a temporary storage location?

For example, if a user shares an image, the image could be placed in an external storage (say AWS S3, for example) and the file share use the temporary storage location. Ideally I’d like to restrict max sharing to 2 weeks, create an S3 store with a retention period of 2 weeks, and when a file gets shared it is copied to the s3 bucket and shared from there.

Another example could be some provisioned SSD drives dedicated to short term storage for faster data retrieval on files which will be hit often during the share duration?

If not strictly able to choose temporary faster storage locations specifically for temporary shares, perhaps there is a way to configure a storage where data is initially stored on SSD with a task/job which would migrate data to secondary slower storage after a period of time?