Last active
May 2, 2018 23:33
-
-
Save rnjailamba/51bd1fb81c5627ecdd13 to your computer and use it in GitHub Desktop.
Keystone js + PDF upload to AWS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In your model simply add a field for the pdf - | |
Admission.add({ | |
name: { type: String, required: true }, | |
state: { type: Types.Select, options: 'draft, published, archived', default: 'published', index: true }, | |
author: { type: Types.Relationship, ref: 'User', index: true }, | |
publishedDate: { type: Types.Date, index: true }, | |
pdf: { type: Types.S3File }, | |
content: { | |
brief: { type: Types.Html, wysiwyg: true, height: 150 }, | |
extended: { type: Types.Html, wysiwyg: true, height: 400 }, | |
} | |
}); | |
After this you need to change keystone.js with the details you get | |
after setting up AWS and creating a bucket and generating a key and secret- | |
keystone.set('s3 config', { | |
bucket: 'xy', | |
key: 'xyz', | |
secret: 'xyz' | |
}); | |
And it works !!!!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry its not working
i'm getting this below error, don't know why!!!
upload failed - Amazon returned Http Code: 400