Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Openfield Creative 62 posts 222 karma points
    Jan 09, 2014 @ 23:50
    Openfield Creative
    0

    Save media through API to CDN

    My company is trying to create a service where users can upload their own photos using a form on the front end. We then want these images to go to a CDN (specifically Amazon S3). We have been successful in saving items directly to the media tree using the API and, using the Amazon S3 Media plugin, we can have items that are uploaded through the umbraco back end go to our Amazon bucket.

    Our problem is that we need to go from the media API to the Amazon bucket. Is there anyway to do this?

  • Robin Hjelmeir 24 posts 85 karma points
    Jan 10, 2014 @ 19:47
    Robin Hjelmeir
    0

    Can I ask what the use case is that requires you to go from umbraco media api to the Amazon bucket?

    I have seen an amazon plugin that will keep a local (server) copy of your images and upload to amazon. The Amazon s3 Media plugin completely overwrites the filesystem so it doesn't use your local server for storing the image files.

    If you have existing media images within your umbraco that need to get copied to the Amazon bucket, you can use this tool: http://s3browser.com/ (only for windows) but you get the idea.

    EDIT: If you really need to write your own plugin that uploads to amazon from the media API you could look at Amazon s3 Media's source code: https://bitbucket.org/gibedigital/umbraco-amazons3provider

  • Openfield Creative 62 posts 222 karma points
    Jan 10, 2014 @ 19:57
    Openfield Creative
    0

    The reason we wanted to go from the api straight to the Amazon bucket is more of a security precaution.  Since anyone can upload a file, we wanted to have them stored elseware in case anyone wanted to do something malicious.  The other appeal of the Amazon bucket was the scalability. We will be advertising this at an event with about 700,000 attendees, so if everyone uploads, a traditional server could fill up really quickly.

    The Amazon S3 Media plugin worked beautifully from within umbraco, but using the api doesn't trigger the plugin.

    So in short the problem is that we are not the ones uploading the photos, its users using the front end form that are uploading.

    Hopefully that clears things up a bit.

  • Robin Hjelmeir 24 posts 85 karma points
    Jan 10, 2014 @ 20:51
    Robin Hjelmeir
    0

    Did you ask the developer of amazon s3 media plugin? Maybe he can suggest ways to hook into the media api. He was very responsive when I asked him questions and he actually fixed something within a day or two for me. I would try that route.

Please Sign in or register to post replies

Write your reply to:

Draft