fix(): Ajuste para remover espaços ou quebra de linhas desnecessárias no arquivo base64 enviado
This commit is contained in:
parent
fc8953af56
commit
188c7a4c94
1 changed files with 2 additions and 1 deletions
|
|
@ -37,9 +37,10 @@ def save_file_from_base64(
|
||||||
try:
|
try:
|
||||||
# Decodifica o Base64
|
# Decodifica o Base64
|
||||||
# file_bytes = base64.b64decode(base64_content)
|
# file_bytes = base64.b64decode(base64_content)
|
||||||
file_bytes = base64.b64decode(
|
clean_base64_content = base64.b64decode(
|
||||||
base64_content.strip().replace("\n", "").replace("\r", "")
|
base64_content.strip().replace("\n", "").replace("\r", "")
|
||||||
)
|
)
|
||||||
|
file_bytes = base64.b64decode(clean_base64_content)
|
||||||
|
|
||||||
# Grava o arquivo em disco
|
# Grava o arquivo em disco
|
||||||
with open(file_path, "wb") as f:
|
with open(file_path, "wb") as f:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue