-
Notifications
You must be signed in to change notification settings - Fork 0
Media CDN
AskNature stores static media and document uploads on an Amazon Web Services (AWS) S3 bucket. In the future as it scales, this media will be served via an AWS CloudFront distribution.
Client-side conditionals limit uploads to 10 MB. If a user attempts to upload a larger file they are alerted that they need to choose a smaller file, and are not presented an option to upload the file.
All new uploads will be routed to a date-specific subdirectory following this structure:
uploads/YYYY/MM/DD/filename
Meanwhile, filenames are changed by the app server to reflect a GMT epoch timestamp and the username of the uploader, followed by the file extension. This method will 1) reduce the risk of filename conflicts, and 2) help administrators track potential issues. For example, a JPG file, bee.jpg
uploaded by a user with username johndoe
at 12:00:00 GMT on April 5, 2015 would be renamed 1428235200_johndoe.jpg
and ultimately be found at:
uploads/2015/04/05/1428235200_johndoe.jpg
All files migrated from AskNature 1.x will remain in their existing directory structure in a separate parent directory from new uploads. The legacy directory structure is:
o/images/uploads/ENTITY_TYPE/ENTITY_MASTERID/filename
Where ENTITY_TYPE and ENTITY_MASTERID represent the specific object the file was originally associated with. For instance, a JPG file, bee.jpg
originally uploaded by a user to a Strategy
page with masterid 123456
would be found at:
o/images/uploads/Strategy/123456/bee.jpg
####Thumbnails
AskNature 1.0 automatically produced un-cropped thumbnails of image uploads with max dimensions of 100px. These thumbnails are stored in the same directory as their parent and the filename is appended with tn_
. For instance, the above bee.jpg
file's thumbnail would be found at:
o/images/uploads/Strategy/123456/tn_bee.jpg