Billie
Billie

Reputation: 19

Is it possible to store PDFs in RDS in AWS?

I wonder if it's possible to store PDF or other documents in RDS in AWS? I know typically you would use s3 or DocumentDB to store documents but I thought it's more of a preference thing. I'm starting to wonder if you can store an entire PDF in RDS? Many thanks.

Upvotes: 0

Views: 1060

Answers (1)

Chris Williams
Chris Williams

Reputation: 35188

Technically yes you can do this, you would end up needing to base64 encode the contents of the PDF (similarly to storing an image in the database) and store this in the database.

Then when you would like to serve it you would need to base64 decode the contents and echo the contents along with a content type of application/pdf.

However this would not be recommended, especially as you're adding extra processing with a chance that extra meta data is removed. I would generally advise storing the original PDF in S3.

Upvotes: 3

Related Questions