Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 超出角度多部分主体长度限制16384_Javascript_Angular_Httpclient - Fatal编程技术网

Javascript 超出角度多部分主体长度限制16384

Javascript 超出角度多部分主体长度限制16384,javascript,angular,httpclient,Javascript,Angular,Httpclient,我正在努力找出发送pdf文件的问题所在 下面是我如何处理输入和服务器请求的代码: public handleFileInput(files): void { let file = files[0]; const reader = new FileReader(); reader.readAsDataURL(file); reader.onload = () => { this.form.controls.Document.patchValue(r

我正在努力找出发送pdf文件的问题所在

下面是我如何处理输入和服务器请求的代码:

public handleFileInput(files): void {
    let file = files[0];
    const reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = () => {
      this.form.controls.Document.patchValue(reader.result);
    };
  }

public createDocument(patientId: number, document: any) {
    const url = 'some url';

    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarybfkRuUmznFJJ5XGG',
        Authorization: 'Bearer ' + this._storageService.getAccessToken(),
      }),
    };

    return this._http.post(url, document, httpOptions);
  }
另外,如果在
内容类型
中删除
边界
,则
内容类型
中缺少
边界
时会出现错误

正确的解决方法是什么