PutObject into directory Amazon s3 / PHP

前端 未结 3 1099
没有蜡笔的小新
没有蜡笔的小新 2021-01-04 00:13

I need to upload my files inside specific directories that I created on my amazon s3 storage. I always uploaded the files on the \"absolute path\" of my bucket doing somethi

3条回答
  •  半阙折子戏
    2021-01-04 00:45

    thank you Jeremy Lindblom, this is my python example that worked for me.

    import boto3
    s3 = boto3.resource('s3')
    data = open('/home/briansanchez/www/red-hat.jpg', 'rb')
    s3.Bucket('briansanchez').put_object(Key='www/red-hat.jpg', Body=data)
    

提交回复
热议问题