Forum

Thread tagged as: Add-on-development, Runway

S3 Upload file naming conventions

Hi Perch- During an S3 asset upload, is the file name referenced within the Perch database the same filename that is saved to S3?

Background: I'm attempting to use Cloudinary to create a bullet-proof Employee Photo Directory system on their site. Cloudinary provides two things that make this system desirable:

1) The ability to automatically crop/scale/fill around a face. With that feature, it doesn't matter what size/aspect ratio the user uploads, I can always get a specific image (say 300px by 300px) that is centered on the face of the employee.

2) The ability to automatically ingest/manipulate images from my S3 bucket. In Cloudinary I can map a 'Cloudinary URL' to a specific S3 bucket. So if I specify a URL like this:

https://res.cloudinary.com/thevariable/image/upload/c_scale,w_300/c_fill,g_face,h_300,w_300,y_20/v1442287240/pec-static/Bugaj_Greg.jpg

...Cloudinary will look for the file in it's local CDN. If it doesn't find it, it will then go to my S3 bucket and look for a file with that name, download it into their system, perform the manipulation and then serve it.

Using Perch, I can create this 'Cloudinary URL' dynamically from an uploaded asset. However, it will only work if it can reference the name of the file that is getting written to S3. I'm under the impression that the file name gets changed when it is saved to S3. If this changed file name is referenced within the Perch database, then I think it will work fine. If it doesn't, then I'm going to have to come up with another system.

Many thanks!

Variable Developer

Variable Developer 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The file name doesn't change when it gets saved to S3 - the system is exactly the same as when the file is saved locally.

Thanks Drew!