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

141
Vistas
problem download large blob file (600mb+)

When a file is loaded with a volume of more than 600MB, it turns out to be empty. The backend completely unloads the file. Used by Axios. Used downloadjs lib for download. I used a lot of lib who likes downloadjs and the result was the same. How can I implement uploading a large file using Axios ?

response

{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 Respuestas
Responde la pregunta

0

We solved the problem on the server side. They began to save the file on the server and send it by reference, without loading the user with a stream.

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