julienmarie Posted June 17, 2014 Share Posted June 17, 2014 Hi, I'd like to create a module to upload directly every file ( images uploaded, css and js minified by AIOM, etc... ) to S3 so it can then be distributed via Cloudfront in a clean way. How would you proceed to detect these file creation/changes ? Thanks ! J. Link to comment Share on other sites More sharing options...
Marty Walker Posted June 17, 2014 Share Posted June 17, 2014 This has been asked for/mentioned/requested here a few times. I think all it will take to produce is someone with the money and/or skills to put it together. It'd be me if had either of those two 2 Link to comment Share on other sites More sharing options...
julienmarie Posted June 17, 2014 Author Share Posted June 17, 2014 Thanks Marty for the answer. I guess i just need to find the right hooks for file writing if they do exist then the rest will be doable. I have the time to make it. Of course I'll share it with the community ( I got a few other modules under dev that I will share along the summer ). J. 1 Link to comment Share on other sites More sharing options...
adrian Posted June 17, 2014 Share Posted June 17, 2014 Here are a couple of relevant hooks for file uploading: Pagefile::install InputfieldFile::processInputAddFile If you don't already know about it, this should be helpful: http://processwire.com/api/hooks/captain-hook/ Link to comment Share on other sites More sharing options...
zyON Posted June 19, 2014 Share Posted June 19, 2014 I've put up a module that works with S3 and Cloudfront. See this topic. Link to comment Share on other sites More sharing options...
julienmarie Posted June 21, 2014 Author Share Posted June 21, 2014 @zyON : Awesome! Why using InputfieldFile::fileAdded and not Pagefile::install hook ? I'm thinking about doing a fork, you mind? j. Link to comment Share on other sites More sharing options...
zyON Posted June 23, 2014 Share Posted June 23, 2014 julienmarie: I think Pagefile:install is not triggered with files added from the admin and that was my major concern. Yes, go ahead, fork it and let's create a better module! 2 Link to comment Share on other sites More sharing options...
March Posted January 10, 2015 Share Posted January 10, 2015 ZyON, Great work on the S3 module. I really hope your product development goes well. It is really a great solution for Amazon Elastic Beanstalk users. Beanstalk has auto-scaling that rebuilds the server instance and can really wreck new files in the assets folder that may have been added in the remote admin console. Your module sets up and installs beautifully and I can see the asset files served from the new Cloudfront and S3 repositories by inspecting elements of the assets folder. However there may be a slight problem with thumbnails or if PW reduces the image file sizes. The image file aspect ratio for some of our files is something like 400x0. I am not sure what this means but the images do not appear and has a broken image icon. I have researched other PW forums about images not uploading or deleting and came across the $config->uploadTmpDir issues in other forums. Before following all the issues with the uploadTmpDir, I tried uninstalling the S3 module and reinstalling. I still get the same problem, the files are not outputting correctly from AWS Cloudfront. Any ideas you may have is welcomed. Thanks again for an awesome module. March Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now