I am using heroku hosted parse-server and parse-dashboard. Using mongoDb as backend. Using AWS S3 adapter to upload images via parse-dashboard. Is there any way to reduce size of the image when uploading from parse-dashboard to S3?
Asked
Active
Viewed 816 times
1 Answers
1
It's possible to do it via cloud code. Write a beforeSave
function to catch and resize the image. Please note that if the image is in the Users table you will need to pass useMasterKey:true
to modify.
This is done in your main.js
file! beforeSave
will run when you upload via the dashboard on a specific table.
Here is a post with a cloud function similar to this:
How do I resize a photo into multiple photo sizes before saving in Parse.Cloud.beforeSave
Also you will need to make use of the parse-image module.

Community
- 1
- 1

Cliffordwh
- 1,422
- 1
- 10
- 18
-
Thanks! I will try it out. – user360 Feb 13 '17 at 14:07
-
I tried it out and it works fine except it is also uploading the original size image along with compressed image. I don't want to upload the original image anymore. – user360 Feb 17 '17 at 17:24