0

I am making a website to get to know aws and Django better. The idea is to let a user upload an excel file, convert it to csv and then let the user download the converted csv file.

I am using amazon s3 for file storage. My question is, what is the best way to make the conversion? Is there any way to access the excel file once it is stored in the s3 bucket and convert it to csv via Django? Sorry if my question is silly but I haven’t been able to find much information on that online. Thanks in advance

Angara kilkiri
  • 137
  • 1
  • 3
  • 8

2 Answers2

1

AWS Lambda is the best way. It has many types of Event triggers. You can specify the bucket and the event(put, delete, copy, etc).

So what you have to do is, create a lambda function which will be triggered only when an object gets inserted into the S3 bucket. In that lambda function you can do your coding such as getting the file from the S3 bucket and the conversion.

Since you are familiar with python already, I suggest to use Boto 3 to get files from the S3 bucket

enter image description here

Check out my blog about AWS lambda with s3 if you want to get a more clearer idea and more about permissions when work with S3 bucket.

My Blog

Ravindu
  • 2,408
  • 8
  • 30
  • 46
0

On every put event of Bucket you can trigger a AWS Lambda function which will convert your File format and save in desired bucket location.

Nirmal
  • 361
  • 2
  • 15