B4J Question B4J File.GetURI - Unexpected results for local file

RonC.

Member
Licensed User
Longtime User
Ran some test code (Windows 7, B4J 2.0):

B4X:
Log("File.GetUri: " & File.GetURI(File.DirApp, "test.html") & CRLF)

Got this result:

B4X:
File.GetUri: file:/c:/Users/rcotton/DOCUME~1/MYBASI~2/MAKEFR~1/Objects/test.html

This was more of what I was expecting:

B4X:
File.GetUri: file:///c:/Users/rcotton/My%20Documents/My%20Basic4Java/MakeFrame/Objects/test.html

or a variant of local file as described on Wikipedia: https://en.wikipedia.org/wiki/File_URI_scheme

The First URI didn't work in Chrome & Firefox Browser, the second URI result did. Chrome browser would convert small c drive name to big C drive name when going to file, Firefox didn't convert drive name small letter c when not uppercase.
 
Last edited:
Top