Skip to content

Commit

Permalink
Merge branch 'main' into fb_adding_multiple_rows
Browse files Browse the repository at this point in the history
  • Loading branch information
drfho authored Jul 13, 2023
2 parents bed421b + 19b5163 commit 3bfd221
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Products/zms/_blobfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ def createBlobField(self, objtype, file=b''):
blob = uploadBlobField( self, objtype, file)
elif isinstance(file, dict):
data = file.get( 'data', '')
if isinstance(data, str):
data = bytes(data,'utf-8')
data = io.BytesIO( data)
blob = uploadBlobField( self, objtype, data, file.get('filename', ''))
if file.get('content_type'):
blob.content_type = file.get('content_type')
Expand All @@ -167,6 +164,7 @@ def uploadBlobField(self, clazz, file=b'', filename=''):
f = None
if isinstance(file,str):
f = re.findall(r'^data:(.*?);base64,([\s\S]*)$',file)
file = bytes(file,'utf-8')
if f:
mt = f[0][0]
file = base64.b64decode(f[0][1])
Expand Down

0 comments on commit 3bfd221

Please sign in to comment.