mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-15 10:05:21 +00:00
user detail api, changed image upload method
This commit is contained in:
@ -41,7 +41,10 @@ def upload_image_to_alibaba(image, filename):
|
||||
# Save the image object to a temporary file
|
||||
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
|
||||
"""write image in temporary file"""
|
||||
temp_file.write(image.read())
|
||||
if type(image) == bytes:
|
||||
temp_file.write(image)
|
||||
else:
|
||||
temp_file.write(image.read())
|
||||
"""auth of bucket"""
|
||||
auth = oss2.Auth(settings.ALIYUN_OSS_ACCESS_KEY_ID, settings.ALIYUN_OSS_ACCESS_KEY_SECRET)
|
||||
"""fetch bucket details"""
|
||||
|
Reference in New Issue
Block a user