我是 appengine 和 html 的新手,需要一些幫助。我已將以下 html 檔案部署到 appengine,但我需要獲取所有影像的 url,如下所示 http(s)://hostname/chosenpath/1 (即影像 1 為 1,依此類推)
任何幫助將不勝感激。謝謝
<!DOCTYPE html>
<html>
<body>
<figure1>
<img src="https://storage.googleapis.com/ccws-cw1-bucket/e4.jpg" alt="Glasgow city" width="500" height="333" title="Glasgow City">
<figcaption>Glasgow City located in Scotland</figcaption>
</figure1>
</figure2>
<img src="https://storage.googleapis.com/ccws-cw1-bucket/image.jpg" alt="Islamabad city" width="500" height="333" title = "Islamabad City">
<figcaption>Islamabad City is the capital of Pakistan</figcaption>
</figure2>
</figure3>
<img src="https://storage.googleapis.com/ccws-cw1-bucket/Istanbul.jpg" alt="Istanbul city" width="500" height="333", title = "Istanbul City">
<figcaption>Istanbul City is a city in Turkey</figcaption>
</figure3>
</body>
</html>
uj5u.com熱心網友回復:
您可能會執行以下操作
有一個特殊的路徑,如
http(s)://hostname/chosenpath/img/1. 這img是您路徑中的一個特殊檔案夾撰寫一個路由處理程式來處理任何以
/img/您手動檢索檔案并將其回傳給用戶的位置結束的路由。您也可以從這里重定向到https://storage.googleapis.comurl
您還可以保留您提到的 url 路徑,但添加代碼以確定用戶請求的檔案是影像檔案(檢查它是否以 .png、jpg 等結尾),然后將用戶重定向到https://storage.googleapis.comurl
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/461041.html
