simov / express-admin

MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
MIT License
1.17k stars 223 forks source link

Support for S3 or cloudinary for images #62

Closed devangpaliwal closed 10 years ago

devangpaliwal commented 10 years ago

Hi,

Do we have support for uploading images to S3 / cloudinary from the upload type control.

I want to upload images to my S3 account.

Thoughts??

Thanks for creating such a wonderful module.

simov commented 10 years ago

You can upload your files inside the postSave callback. Take a look at the so called events here

Below this line is an example of sending some request after saving the record.

You should use node-inspector to see what's inside the args parameter. Somewhere there should be the name of your file (because it can get renamed if there is a file with the same name in you upload directory). The next step is to read the file like you usually do in node, and send it to your server.

simov commented 10 years ago

@devangpaliwal just improved the events documentation

I added an example of uploading to cloudinary.com, and you can try it out here