Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
How to change the value of the “alternativeText” property of an image after having uploaded it to the route /upload API?

I’ve gone through the docs without any answer to my problem. I download an image that is on a bucket and I want to upload it to Strapi via the path "/upload" API. No problem, it works except that the “alternativeText” property is empty. I want to fill this value. Following the POST response from the image upload, I got the image ID. Now I want to update the “alternativeText” property by making a POST request on the route /upload?id=imageId with a payload but it does not work. I do it in Python. How do you do it on your side please?

files = {
    'files': 
        (
            'image_name', 
           'path/files' , 
            'type_mime'
        ),
}

headers = {
    "accept" : "application/json",
    "Authorization" : 'Bearer my_token' ,
}

responseUploadImage= requests.post(
    url= 'http://localhost:1337/api/upload',
    files=files,
    headers=headers
)

content = json.loads(responseUploadImage.content)
imageID= content[0]['id']

payload= json.dumps({
    'fileInfo': {"alternativeText":"alt","caption":"caption","name":"iamage_name"}
})

response= requests.post(
    url=  'http://localhost:1337/api/upload?id=' + str(imageID),
    data=payload,
    headers = {
        "accept" : "application/json",
        "Authorization" : 'Bearer ' + os.environ['API_KEY'],
    }
)
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda