we just map the s3 storage as a file system into our instance and actually use file monitoring to distribute the file to the different locations we need them at and also create different versions of the file (lower quality, etc).

Ruben

Joshua Portway wrote:

Thanks - that looks great.
I think maybe a system like this to upload to a local filestore and then something like Jets3t ( http://jets3t.s3.amazonaws.com/index.html ) to synchronise the local file store with S3 would be perfect. The only remaining thing would be some way to generate the correct URL depending on whether or not the file had been deployed to S3 yet or not. And possibly some way to only publish the file to S3 when the node was published to a public magnolia instance. hmmm.

If I end up doing this I'll post any results back on the wiki.
thanks again for the help.

Josh

On 6 Apr 2009, at 16:31, Ruben Reusser wrote:


the second one - magnolia has a nice file upload infrastructure already handling multipart forms

the following code gets rthe file and puts it somewhere else

MultipartForm form = (MultipartForm)(request.getAttribute("multipartform"));
              if(form != null)
              {
InputStream is = form.getDocument("files").getStream(); fileName = System.currentTimeMillis()+"_"+form.getDocument("files").getFileNameWithExtension();
                      file = path+"/"+fileName;
                      OutputStream os = new FileOutputStream(file);
                      byte[] buffer = new byte[1024];
                      int len = is.read(buffer);
                      while(len > 0)
                      {
                              os.write(buffer, 0, len);
                              len = is.read(buffer);
                      }
                      os.close();
  }

Joshua Portway wrote:

Do you mean that the file upload has to be done separately (outside magnolia) and then you create a node that references the file from within magnolia? If so, that's pretty much what we used to do before we started using S3+Cloudfront (which we now use instead of straight apache because it makes for a very cost effective content delivery network).

Or do you mean that you've written a page that allows users to upload directly to the file system from within magnolia, then automatically creates the reference node?

Josh


On 6 Apr 2009, at 15:42, Ruben Reusser wrote:


We go a different route for that - we just use a regular page where one can upload a file and just create a node with a reference to the file but store the file somewhere on the file system where it can be directly served from apache.

Ruben

Joshua Portway wrote:

Has anyone tried to set up a system whereby the DMS uses Amazon S3 to store and serve files? I have a site that currently uses Magnolia for managing most of it, but has quite a lot of movie content - the movie files are up to 600mb in size, and need to stream smoothly, hence I currently use Amazon S3 storage + Cloudfront content delivery network. The solution works pretty well, but the problem is that there's no way to manage the movie files from within Magnolia, which makes uploading and changing movies complex, time consuming and error prone.

Is there any way to change the back end file system used by the DMS to use S3 (or something similar)? My idea would be that the DMS would keep metadata about files in the database, but actually store the files on S3 (perhaps with a local master copy too, just so that everything is in one place for migrations etc). When a file was requested it would return the S3 URL for the file so it would be served directly from Amazon through their content delivery network.

Josh


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to