0

I have mounted one of my buckets to my server, I am able to access and write files to it, but now I wish to play files. I have written small api that returns static file from my mounted path of s3 bucket in my server

def get_file(path):
    if not path.startswith('/'):
        path = '/' + path
    print "=======/file==== path : ", path
    if os.path.exists(path):
        print("true")
        return static_file(path, root="/")
    return static_file("404.mp4", root="/")

But it is not playing, it is giving 500 error in console? please suggest alternatives for this. any help would be appreciated.

Andrew Gaul
  • 2,296
  • 1
  • 12
  • 19
Varun Singh
  • 444
  • 6
  • 21
  • 1
    Side-note: `s3fs` is not a good way to use Amazon S3, especially for production usage. It would be better to use an AWS SDK to access S3. As for serving content, it would be much better to have the client access content directly from S3, possibly using a **pre-signed URL** for privacy. – John Rotenstein Oct 09 '19 at 01:30
  • Yes actually accessing part is directly using presigned url, but we are mounting just so we are able to process files and start writing processed output also in s3 – Varun Singh Oct 10 '19 at 23:00

0 Answers0