Hi,
in a testapp, I want to access some web files, which are not in the same location as the app is.
Unhandled UnsupportedFormatException
Message: Passing non-absolute shell paths is not currently supported.
I do this with absolute paths like this:
Dim f2 As FolderItem
Dim c2 As String
Dim t22 As TextInputStream
f2 = GetFolderItem(filePath, FolderItem.PathTypeShell)
If f2 <> Nil Then
If f2.Exists Then
t22 = TextInputStream.Open(f2)
t22.Encoding=Encodings.UTF8
self.OutputArea.Text = t22.ReadAll
txt_pfad.Text = filePath
End If
End if
This works good on Mac, but not on Linux on our Cloud-Server. I always get the following error:
[quote]Unhandled UnsupportedFormatException
Message: Passing non-absolute shell paths is not currently supported[/quote]
what can I do? I’m passing a shell path?!
Hi Lars,
My understanding of “non-absolute not supported” means “only absolute supported”, I’m not sure ShellPath is considered “absolute” under Linux.
The doc says “PathTypeAbsolute is deprecated. Use PathTypeNative instead.”
I don’t know where “filePath” is coming from.
So, if you have the original file = myFile I’d try:
filePath = myFile.NativePath
f2 = GetFolderItem(filePath, Folderitem.PathTypeNative)
'or simply
f2 = GetFolderItem(myFile.NativePath, Folderitem.PathTypeNative)
no, I have the absolute path in a string (“filePath”) like /Users/myuser/Projects/path/file.json
and want to generate the folder item from this.
NativePath doesn’t work, it’s throwing a NilObjectException, since “f2” (the folder item) is nil.