首页 > 解决方案 > 上传大型视频文件时在角度 12 中请求超时

问题描述

上传大型视频文件时,我在 Angular 12 中遇到请求超时问题。(200 MB)

后端 API 没有问题,因为我已经用邮递员测试了 API,文件已上传。

当我从本地主机上传文件时。它也工作正常。

上传时服务器只有问题,随机超时

import { HttpClient, HttpHeaders } from '@angular/common/http';
import { timeout } from 'rxjs/operators';

return this.http.post(uri,data,{ headers: this.headers}).pipe(
    timeout(1000 * 60 * 60 * 60 ) //rxjs timeout operator
);

谢谢

标签: angularfile-upload

解决方案


推荐阅读