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

158
Views
problema al descargar un archivo blob grande (600mb+)

Cuando se carga un archivo con un volumen de más de 600 MB, resulta estar vacío. El backend descarga completamente el archivo. Utilizado por Axios. Utilicé downloadjs lib para descargar. Usé mucho lib a quien le gusta downloadjs y el resultado fue el mismo. ¿Cómo puedo implementar la carga de un archivo grande usando Axios?

respuesta

 {data: 'Id;Email;ClientDwhId;Number;16_int;22_datetime;22… headers: {…}, cancelTokenSource: {…}} cancelTokenSource: cancel: ƒ cancel(message) token: CancelToken promise: Promise [[Prototype]]: Promise [[PromiseState]]: "pending" [[PromiseResult]]: undefined [[Prototype]]: Object [[Prototype]]: Object data: "Id;Email;ClientDwhId;Number;16_int;22_datetime;2 headers: content-disposition: "attachment; filename=File.csv; filename*=UTF-8''File.csv" content-length: "42277" content-type: "text/csv" [[Prototype]]: Object [[Prototype]]: Object
 import * as contentDisposition from 'content-disposition'; import * as downloadjs from 'downloadjs'; import { Observable } from 'rxjs'; import { tap } from 'rxjs/operators'; import { ApiResponse } from '../api'; const defaultContentType = 'text/plain'; const defaultFilename = 'file.txt'; const downloadFile = (response: ApiResponse<BlobPart>, filename?: string) => { //create filename if (!filename) { const parsedContentDisposition = response.headers['content-disposition'] && contentDisposition.parse(response.headers['content-disposition']); filename = parsedContentDisposition && parsedContentDisposition.parameters ? parsedContentDisposition.parameters.filename : defaultFilename; } //create content type const contentType = response.headers['content-type'] ? response.headers['content-type'] : defaultContentType; //function from downloadjs library downloadjs( new Blob([response.data]), filename, contentType,); }; export const downloadFileFromStream = (filename?: string) => ( stream$: Observable<ApiResponse<BlobPart>>, ) => stream$.pipe(tap(response => downloadFile(response, filename))); //run downloadFile function after response
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Resolvimos el problema en el lado del servidor. Comenzaron a guardar el archivo en el servidor y enviarlo por referencia, sin cargar al usuario con un flujo.

about 4 years ago · Juan Pablo Isaza 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!