0
我在我的項目(/Content/Img/myPic.png)中有一個img,我需要將其轉換爲基本64並將其保存在字符串變量中。將本地img轉換成Base64字符串
喜歡的東西:
let myFile = File("/Content/Img/myPic.png");
let fileBase64 = Base64Transformer(myFile);
我不知道如何訪問我的文件,並利用改造它是什麼。 有什麼想法?
在現代瀏覽器中,檢查出https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/btoa – Carl
http://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-javascript-answer-20285053好像是你在 – Carl
之後好,但是我怎樣才能訪問這個文件給window.btoa( )? – Lempkin