【发布时间】:2019-02-26 12:18:05
【问题描述】:
我的客户端上有两个<input> 标签来选择一个文件。一旦客户端选择了文件(24 位 BMP 640*480),我必须制作一个 http.post 以便我可以保存每个文件的 imageData 并在需要时制作一个 http.get。我尝试发布一个 ImageData 对象或只是一个 Uint8ClampedArray 但我遇到了一些错误。现在我尝试将它转换为 base64 并发送它,但我仍然没有得到任何东西。
这是我的 http.post:
public submitInfo(): void {
this.http.post("http://localhost:3000/sologame", { "name": this.game.gameName, "image1": this.game.picture }, HTTP_OPTIONS).pipe(
catchError(this.handleError("submitInfo"))).subscribe();
}
如何发送我的图像数据?
【问题讨论】:
标签: html angular typescript http input