test
This commit is contained in:
parent
b1a21ffe16
commit
ca99f9f1fb
|
@ -194,8 +194,7 @@ def validate_file_size_type(file: IO):
|
||||||
# return f'{static}/{folderName}/{picture_name}'
|
# return f'{static}/{folderName}/{picture_name}'
|
||||||
|
|
||||||
|
|
||||||
|
def upload_file(file_name, bucket_name, object_name=None):
|
||||||
async def upload_file(file_name, bucket_name, object_name=None):
|
|
||||||
ConnectionUrl = f"https://{settings.AccountID}.r2.cloudflarestorage.com/images"
|
ConnectionUrl = f"https://{settings.AccountID}.r2.cloudflarestorage.com/images"
|
||||||
r2 = boto3.client(
|
r2 = boto3.client(
|
||||||
"s3",
|
"s3",
|
||||||
|
@ -215,9 +214,6 @@ async def upload_file(file_name, bucket_name, object_name=None):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def save_picture(file, folder_name: str = "", file_name: str = None):
|
async def save_picture(file, folder_name: str = "", file_name: str = None):
|
||||||
import io
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
randon_uid = str(uuid4())
|
randon_uid = str(uuid4())
|
||||||
_, f_ext = os.path.splitext(file.filename)
|
_, f_ext = os.path.splitext(file.filename)
|
||||||
|
|
Loading…
Reference in New Issue