Local Files

That stupid forum software does not let me edit. Please disregard the previous post. Here :

Dim f As FolderItem f=GetFolderItem("C:\\Users\\isb\\Desktop\ etronic\\VARCHART_JGantt_JavaBeans_3.1_SR_0000\\Samples\\JGanttSample\\JGanttSampleApplet.html", FolderItem.PathTypeShell) HTMLViewer1.LoadPage(f)

Thank you for your reply, but I still have the same error :frowning:
I tried too:

f=new FolderItem("C:\\pokus.html", FolderItem.pathtypeabsolute)
f=getFolderItem("file:///C:/pokus.html", FolderItem.PathTypeShell)
f=Volume(0).Child("pokus.html")

and the same error…
I dont know, what I do wrong?

Are you creating a web app and trying to load a file from the User’s system? That’s not possible. You can only load files on the server.

[quote=112064:@Krystof Jurecka]Thank you for your reply, but I still have the same error :frowning:
I tried too:

f=new FolderItem("C:\\pokus.html", FolderItem.pathtypeabsolute)
f=getFolderItem("file:///C:/pokus.html", FolderItem.PathTypeShell)
f=Volume(0).Child("pokus.html")

and the same error…
I dont know, what I do wrong?[/quote]

If indeed you are not running a web app…

You want to verify the folderItem is valid :

if f.Exists = True then msgbox "OK" else msgbox "FolderItem invalid" end if

Ou, OK. So thank you for your time. I want create web app. And can I run the files, which are in the same folder? I have project in the same folder as .html.

First, try to post in the Web channel if it is about a web app. This will save a lot of time.

Second, do not use windows style path. Instead use the Xojo way f=Volume(0).Child("pokus.html") so your Windows path c:\\pokus.html will be correctly translated into /pokus.html when run in the host Linux environment (unless your server is Windows).

It is best to place all your HTML files in the same folder on the server, so you can locate them more easily.

Browser.LoadPage(f.urlpath) should do the trick. It translates in a correct UNC style path.

So, nothing help me, but thank you very much for your time :slight_smile:
I create in VMware windows server with IIS and now I run it trough .showURL. I need it, because html file run there java (.jar) and .xml file. So my problem is solved.

[quote=112398:@Krystof Jurecka]So, nothing help me, but thank you very much for your time :slight_smile:
I create in VMware windows server with IIS and now I run it trough .showURL. I need it, because html file run there java (.jar) and .xml file. So my problem is solved.[/quote]

Sorry if “nothing help me”, but frankly your problem seems more obscure than the small piece of code you posted. Could be somewhere else.

If you run your project in VMWare, place pokus.html on the desktop and do only that :

f = specialfolder.desktop.child("pokus.html") HTMLViewer1.LoadPage(f)

If it still does not work, nobody here can help you but an exorcist :wink:

Michel look at the screenshot, it’s a web app.

That’s right. On a host, SpecialFolder.desktop does not exist.

EXCEPT when run in the IDE, a web app accesses the file system of the local machine. I verified. So the example I posted must work.

But surely a deployed web app has no access to the user’s filesystem like that?

Basically, a server is nothing else than a Linux box (even if sometimes virtual). So all FolderItem commands work the same. If permissions allow it, a web app can open files anywhere on the machine.

On my server, I have a folder at /home/username/MyFiles where I store files for download. One of my site html files are located in /home/username/domains/match-software.com/public_html.

What maybe confusing for some is that when accessing by FTP, what shows as the root is in fact /home/username/

So I cannot understand why Krystof keeps saying that such an elementary code does not work for him. It seems he did not even try checking if the file existed, as I advised. I strongly suspect his path is wrong.