Hi :wave: `FileInput` seems to return a fake path ...
# compose-web
j
Hi đź‘‹
FileInput
seems to return a fake path when running a Kotlin web app using Compose for Web locally. What would be the way to go to get a real path and be able to render the image selected, for example? The fakepath is obviously not valid when used on an
Img
o
j
Excuse me. Does this solve the fakepath issue? 🤔
Right now, I am getting
C:\fakepath\sample small.png
as the path for an image called
sample small.png
. The window-ish fakepath is added by the browser, or Compose
o
not directly of course. the “fake path” is not really related to compose for web. It would be the same path for the plain html <input type=“file” … > but the proposed approach - using
URL.createObjectURL()
can help convert the fake path into string reference for your file
j
oh! I see
works like a charm 👏 thanks!