我正在运行Microsoft Azures计算机视觉OCR使用JavaScript,只能上传带有HTML地址的图像。你知道吗
var sourceImageUrl = document.getElementById("inputImage").value;
document.querySelector("#sourceImage").src = sourceImageUrl;
我想从本地源上传图像以复制此python代码:
image_path = '/Users/FelixWallis/Desktop/Flask_t1/files'
image_data = open(image_path, "rb").read()
这可能吗?如果可能,怎么可能?你知道吗
请尝试以下代码:
它将从用户的桌面选择一个文件。你知道吗
您可以尝试使用“文件”协议:
file:///Users/FelixWallis/Desktop/Flask_t1/files/my_image.jpg
或者使用启动本地web服务器并将文件添加到静态文件中。你知道吗
不,不要那样做。我假设您有一个类型为文件的输入元素。你知道吗
你也可以upload a file with Node。你知道吗
相关问题 更多 >
编程相关推荐