1 Reply Latest reply on Sep 30, 2007 10:10 PM by ajohnson1200

    Images, videos and attachments as references rather than DB blobs

      If a community gets fairly large in clearspace X it does seem that storing media formats (images, attachments, and videos) in the DB could cause some pain points.  We'd like to move them to a NAS like storage or and on display to the user change the url to use a CDN to serve these files.  Is there a good place to hook into the upload functions to save these off to different location and just keep a reference to the files?  When displaying the images could a Macro be used to replace the storage URL with a CDN display URL (akamai, S3, limelight, etc).

        • Re: Images, videos and attachments as references rather than DB blobs

          hi rmonge,

           

          I don't have a complete answer for you but I can get you started. There is an event that's fired when an attachment is uploaded:

          AttachmentEvent.ATTACHMENT_ADDED

          You should be able to register for that event using the class AttachmentEventDispatcher.

          We don't currently use a macro for displaying links to attachments / images (but that's a great idea) so in order to do this globally you'd probably either have to replace any references you see to "... /servlet/JiveServlet/download/ ..." with a reference to your CDN or modify JiveServlet to read from or redirect to the CDN.

           

          Cheers,

           

          AJ