How To Upload Images to Amazon S3 Using Perl?

我的梦境 提交于 2019-12-04 10:14:59

That code won't upload the file - it's simply setting the value associated with the key "testing.txt" to "T". If you want to upload a file you could use the add_key_filename method:

The method works like add_key except the value is assumed to be a filename on the local file system. The file will be streamed rather then loaded into memory in one big chunk.

Something like:

$bucket->add_key_filename(
    'image-key.jpg',
    'local-filename.jpg',
    {
        content_type => 'image/jpeg',
    }
);

Adjust the content type as required.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!