Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hoping this is the right place to be asking this but just a quick question, I'm trying to find out whether it is possible to link to a file that is added manually to Amazon S3 (not uploaded through the Storage API module) or whether it is important that files accessed through the Drupal site are loaded into the S3 bucket through the Storage API module.
Thanks so much
Comments
Comment #2
Perignon CreditAttribution: Perignon commentedThere isn't a direct tie to the file in S3 that makes it so you cannot swap out the files. I had the problem of needing to serve files as big as 10GB. The only way to upload files that size is to use Multipart. So I uploaded a "fake" file through Drupal that was like 2mb and the use an S3 client to upload the real file use the same name as the "fake" file into the bucket that Drupal uses. The only thing about doing is the file size as recorded in Drupal is not correct, but you can manually change that in the DB if it is a problem.
So yes it is possible but you have to do the "fake" file upload to get it into the module the easiest way.
Comment #3
kirstykf CreditAttribution: kirstykf commentedThanks so much Perignon, that was hugely helpful!
Comment #4
selfsimilar CreditAttribution: selfsimilar commentedI'm creating a mobile file uploader app that writes directly to S3 and returns a code that can be used on our Drupal site to claim that file. Once the file is claimed, the file is moved from a temporary location in S3 to a permanent location at which point I'd like to link the existing file to an entry on a file field that has historically been using the Storage API to place uploads in the same S3 bucket.
I'm currently going through the workings of the Storage API module to better understand the flow but I figure I'll probably have to extend the API to support this use case. If anyone can offer some advice on where to begin extending or modifying the current API I'd greatly appreciate it.
Comment #5
Perignon CreditAttribution: Perignon commentedYou are correct. Programmatically creating the file in Storage API is something this module is missing. I had the same problem but instead of writing code I uploaded my files manually as I only had a limited number of files.
If you can create the capability, I will be more than happy to commit the code!