Javascript 上载不在windows上工作的大文件? 我试图用角来上传大的FLIGLATE的人类基因组TAR文件,最小2.5GB。如果我从Linuxin的任何浏览器、chrome或Firefox上传它,它都可以工作,但同样的文件上传在windows甚至chrome浏览器上都不工作。下面是一个服务文件 import { HttpHeaders, HttpClient, HttpParams, HttpEventType } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class GenomeService { baseApiUrl = '###myapiurl###'; public postGenome = (resrc: string, item: any): Observable<any> => { this.headers = this.headers.delete('Content-Type'); return this._http.post(this.baseApiUrl + resrc + "/", item, { headers: this.headers, withCredentials: true, reportProgress: true, observe: 'events' }).pipe( map((event) => { switch (event.type) { case HttpEventType.UploadProgress: const progress = Math.round(100 * event.loaded / event.total); return { status: 'progress', message: progress }; case HttpEventType.Response: return event.body; default: return "Error......${event.type}"; } }), finalize(() => { console.log("done"); }) ); } }
在浏览器“网络”选项卡中,它显示为net::ERR\u CONNECTION\u RESET。我不知道我在哪里犯了错误。检查您后端的设置一些称为maxRequestSize或maxRequestLength的参数。如果我们知道您使用的是哪种后端,那就容易多了。 如果它是点网络,它会是这样的:Javascript 上载不在windows上工作的大文件? 我试图用角来上传大的FLIGLATE的人类基因组TAR文件,最小2.5GB。如果我从Linuxin的任何浏览器、chrome或Firefox上传它,它都可以工作,但同样的文件上传在windows甚至chrome浏览器上都不工作。下面是一个服务文件 import { HttpHeaders, HttpClient, HttpParams, HttpEventType } from '@angular/common/http'; @Injectable({ providedIn: 'root' }) export class GenomeService { baseApiUrl = '###myapiurl###'; public postGenome = (resrc: string, item: any): Observable<any> => { this.headers = this.headers.delete('Content-Type'); return this._http.post(this.baseApiUrl + resrc + "/", item, { headers: this.headers, withCredentials: true, reportProgress: true, observe: 'events' }).pipe( map((event) => { switch (event.type) { case HttpEventType.UploadProgress: const progress = Math.round(100 * event.loaded / event.total); return { status: 'progress', message: progress }; case HttpEventType.Response: return event.body; default: return "Error......${event.type}"; } }), finalize(() => { console.log("done"); }) ); } },javascript,angular,linux,windows,file-upload,Javascript,Angular,Linux,Windows,File Upload,在浏览器“网络”选项卡中,它显示为net::ERR\u CONNECTION\u RESET。我不知道我在哪里犯了错误。检查您后端的设置一些称为maxRequestSize或maxRequestLength的参数。如果我们知道您使用的是哪种后端,那就容易多了。 如果它是点网络,它会是这样的: <httpRuntime maxRequestLength="xxx" /> 根据您的需要设置它检查后端的设置一些称为maxRequestSize或maxRequestLength的参数。如果
<httpRuntime maxRequestLength="xxx" />
根据您的需要设置它检查后端的设置一些称为maxRequestSize或maxRequestLength的参数。如果我们知道您使用的是哪种后端,那就容易多了。 如果它是点网络,它会是这样的:
<httpRuntime maxRequestLength="xxx" />
根据需要设置它如果您使用IIS托管应用程序,则默认上载文件大小为4MB。要增加它,请在web.config中使用下面的部分
注意:maxAllowedContentLength以字节为单位测量,而maxRequestLength以千字节为单位测量,这就是此配置示例中值不同的原因:
希望这有帮助。如果您使用IIS托管应用程序,则默认上载文件大小为4MB。要增加它,请在web.config中使用下面的部分
注意:maxAllowedContentLength以字节为单位测量,而maxRequestLength以千字节为单位测量,这就是此配置示例中值不同的原因:
希望这有帮助。在component.ts文件中。您使用的是哪种后端?在component.ts文件中有F5之类的负载平衡器吗?您使用的是哪种后端?有F5之类的负载平衡器吗?我在linux配置文件中尝试过这种解决方案,但不起作用..:-我尝试在linux配置文件中使用这种解决方案,但它不起作用..:-