You've already forked FrameTour-RenderWorker
Init
This commit is contained in:
17
util/oss.py
Normal file
17
util/oss.py
Normal file
@ -0,0 +1,17 @@
|
||||
import requests
|
||||
|
||||
|
||||
def upload_to_oss_use_signed_url(url, file_path):
|
||||
"""
|
||||
使用签名URL上传文件到OSS
|
||||
:param str url: 签名URL
|
||||
:param str file_path: 文件路径
|
||||
:return bool: 是否成功
|
||||
"""
|
||||
with open(file_path, 'rb') as f:
|
||||
try:
|
||||
response = requests.put(url, data=f)
|
||||
return response.status_code == 200
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
Reference in New Issue
Block a user