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

371
Vistas
upload images in vuejs to laravel (aws s3)

I'm trying to upload a photo in vuejs and get it in laravel to send to s3 from aws.

When I upload the photo through Insomnia it uploads correctly, but when I upload it through vuejs, it returns empty.

const ob = new FormData();
  ob.append("picture", this.file);
  const res = await this.$http.post('/members', ob, {
  headers: 
  {
   'Content-Type': 'multipart/form-data'
  }
});

public function getUrlS3($foto){
          
        $s3Client = new S3Client([
            'region' => 'us-east-1',
            'version' => '2006-03-01',
        ]);
        

        $result = $s3Client->putObject([
                'Bucket' => 'bucket-name',
                'Key'    => 'file' . '.png',
                'ACL'        => 'public-read',
                'SourceFile' => $foto, 'r'          
        ]);
   
        
        return $result;
}

$aws = new S3Controller();
$file = $request->file('picture');
$rt = $aws->getUrlS3($file);

Content-Disposition: form-data; name="picture"; filename="chiru.jpeg"
Content-Type: image/jpeg

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