服务器重启后,上传的图像仅在 Linux 的 Azure Web Apps 中可见

Uploaded images only viewable in Azure Web Apps for Linux after server restarted

My Azure Web Apps for Linux 应用程序成功允许用户上传图像。 图像已成功存储在目录 BankScans 中。

我尝试在浏览器中显示图像:

<img width="516" height="730" class="theCanvas img-fluid" style="transform-origin: 50% 50%;
transition:none; cursor: move; transform: matrix(1, 0, 0, 1, 0, 0);" draggable="false"
src="BankScans/f79f76bf-a4f1-4495-1234-91c97d6a70bd.jpg">

图片没有显示。但是,如果我为 Linux 重新启动 Azure Web 应用程序,则会显示图像。

知道如何让用户看到图像,而无需先重新启动 Web 应用程序吗?

这个问题的答案与@BalusC在Uploaded image only available after refreshing the page

中的答案相同

简而言之,上传的图片不应保存在部署文件夹中。

在我的例子中,只需将 BankScans 目录的目录更改为部署文件夹之外即可解决问题,并且不需要额外配置 Tomcat。