Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the s3cmd presigned upload test method?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "s3cmd preset upload test method is what", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "s3cmd preset upload test method is what"!

from boto.s3.connection import S3Connectionimport requestsimport botoaccess_key = 'xxx'secret_key = 'xxx'host = 'xx.xx.xx.xxx'bucketname = 'test'keyname= 'abc'uploadstr='for test'conn = boto.connect_s3( aws_access_key_id = access_key, aws_secret_access_key = secret_key, host = host, is_secure=False, # uncommmnt if you are not using ssl calling_format = boto.s3.connection.SubdomainCallingFormat(), )bucket = conn.get_bucket(bucketname) presened_url= conn.generate_url(300,"PUT", bucketname, keyname)key = bucket.new_key(keyname)response = requests.put(persigened_url,data=uploadstr)key = bucket.get_key(keyname)url = key.generate_url(300)response = requests.get(url)print response.text Curl -vnL --request PUT --upload-file /tmp/abc --url + presented_url file upload to this, I believe we have a deeper understanding of "s3cmd preset upload test method is what", may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report