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

441
Views
¿Cómo cargar Excel a Amazon S3 usando AWS Lamda y dotnet Core 5?

Así que estoy usando el proyecto AWS Lamda para cargar un archivo de Excel en S3. Se cargó en S3, pero el problema es que se corrompió una vez que se cargó. Funciona bien en local, pero cuando lo implemento en AWS no funciona.

A continuación se muestra mi código.

Controlador.cs

 IFormFile file = Request.Form.Files[0]; UploadtoS3("Test", file, file.FileName);

Subir al método S3

 UploadtoS3(string bucketName, IFormFile file, string fileName) { System.IO.Stream MyStream = file.OpenReadStream(); PutObjectRequest request = new PutObjectRequest { BucketName = bucketName, Key = fileName, InputStream = MyStream, ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }; PutObjectResponse response = await _client.PutObjectAsync(request); }

Puerta de enlace API de AWS

También he añadido posibles tipos binarios.

ingrese la descripción de la imagen aquí

Por favor ayuda. Gracias de antemano

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Ante un problema similar. En mi caso, la etapa de redistribución de la API ayudó

También se actualizó LambdaProxyFunction

 protected override void Init(IWebHostBuilder builder) { builder .UseStartup<Startup>(); RegisterResponseContentEncodingForContentType("multipart/form-data", ResponseContentEncoding.Base64); RegisterResponseContentEncodingForContentType("application/vnd.ms-excel", ResponseContentEncoding.Base64); RegisterResponseContentEncodingForContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", ResponseContentEncoding.Base64); RegisterResponseContentEncodingForContentType("application/vnd.ms-excel.sheet.macroEnabled.12", ResponseContentEncoding.Base64); }
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!