Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
no se puede cargar el archivo a la subcarpeta del cubo principal

Estoy tratando de cargar un archivo de error en AWSS3, pero muestra un error como "El depósito al que intenta acceder debe abordarse mediante el punto final especificado. Envíe todas las solicitudes futuras a este punto final: "test9011960909.s3.amazonaws.com"."

También especifiqué 'región' => 'us-east-1' pero aún ocurre el mismo error.

está funcionando cuando especifico

 'Bucket' => $this->bucket,

pero quería cargar el archivo en la subcarpeta del cubo principal

 'Bucket' => $this->bucket . "/" . $PrefixFolderPath,

Ya apliqué la respuesta aprobada de AWS S3: el depósito al que intenta acceder debe abordarse mediante el punto final especificado

pero sigo recibiendo el mismo error, estoy usando php

Código:

 use Aws\S3\S3Client; use Aws\S3\Exception\S3Exception; class AWSS3Factory { private $bucket; private $keyname; public function __construct() { $this->bucket = AWSS3_BucketName; $this->keyname = AWSS3_AccessKey; // Instantiate the client. } public function UploadFile($FullFilePath,$PrefixFolderPath="") { try { $s3 = S3Client::factory(array( 'credentials' => array( 'key' => MYKEY, 'secret' => MYSECKEY, 'region' => 'eu-west-1', ) )); // Upload data. $result = $s3->putObject(array( 'Bucket' => $this->bucket . "/" . $PrefixFolderPath, 'Key' => $this->keyname, 'SourceFile' => $FullFilePath, 'StorageClass' => 'REDUCED_REDUNDANCY' )); return true; // Print the URL to the object. //echo $result['ObjectURL'] . "\n"; } catch (S3Exception $e) { echo $e->getMessage() . "\n"; } } }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Debe agregar $PrefixFolderPath no a 'Bucket' sino a 'Key' :

 $result = $s3->putObject(array( 'Bucket' => $this->bucket, 'Key' => $PrefixFolderPath . "/" . $this->keyname, 'SourceFile' => $FullFilePath, 'StorageClass' => 'REDUCED_REDUNDANCY' ));
over 4 years ago · Santiago Trujillo Report

0

Debe crear la instancia s3 de otra manera, así:

 $s3 = S3Client::factory([ 'region' => '', 'credentials' => ['key' => '***', 'secret' => '***'], 'version' => 'latest', ]);
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!