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

194
Vistas
AWS PHP Upload cannot upload files larger than 15mb

I have been able to upload files to my bucket using the below code from the AWS PHP SDK. The problem is when I try to upload files that are larger than 15 mb, the script throws an error. Otherwise it works as expected. Any Ideas what I'm doing wrong? Thanks in advance.

require $dir . 'aws/aws-autoloader.php';
    $s3Client = new Aws\S3\S3Client(array(
    'version' => 'latest',
    'region' => 'us-west-2',
    'credentials' => array(
        'key' => 'KEY',
        'secret' => 'SECRET',
    )
));
$result = $s3Client->putObject(array(
    'Bucket' => 'eot-resources',
    'Key' => $org_id."_".$_FILES["fileToUpload"]["name"],
    'SourceFile' => $_FILES["fileToUpload"]["tmp_name"],
    'Body'        => new GuzzleHttp\Psr7\Stream(fopen($_FILES["fileToUpload"]["tmp_name"], 'r')),
    'ACL' => 'public-read',
    'StorageClass' => 'REDUCED_REDUNDANCY',
    'Metadata' => array(
        'Foo' => 'abc',
        'Baz' => '123'
    )
));
echo "URL: ".$result['ObjectURL'] . "<br>";

I get the following error when trying to upload a large file bigger than 15mb. Other than that it works.

Warning: fopen(): Filename cannot be empty in /Users/xxx/Code/xxx/wp-content/plugins/xxx/parts/part-upload_file.php on line 37.

Line 37 reads..

'Body'        => new GuzzleHttp\Psr7\Stream(fopen($_FILES["fileToUpload"]["tmp_name"], 'r')),

Any help/advice/tips would be appreciated.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I suspect your server has a limit on the size of file that can be uploaded. Check using phpinfo() and look for post_max_size and upload_max_filesize. Assuming that's the problem then you can increase the limit.

about 4 years ago · Santiago Trujillo Denunciar
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