addamroy 36 Posted August 18, 2014 Report Share Posted August 18, 2014 I'm trying to load some local images in the browser window with HTML but I can't figure out the proper syntax... I tried applicationfolder/images/image.jpg but that doesn't do anything. What is the proper syntax for this? (It wouldn't work for me if I had to get the full local path to an image) Quote Link to post Share on other sites
pash 504 Posted August 18, 2014 Report Share Posted August 18, 2014 Fro file path replace "\" to "/" Sample Quote Link to post Share on other sites
addamroy 36 Posted August 18, 2014 Author Report Share Posted August 18, 2014 That only works if every single user has the image on their desktop. The images I'm trying to display are always in the same folder as the software (applicationfolder), so that absolute path won't really work for me as it would be different for everyone using it.. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 19, 2014 Report Share Posted August 19, 2014 tryspecial folder and use Application will use application folder and any other folder within if not work then set path first in a variable TC Quote Link to post Share on other sites
addamroy 36 Posted August 19, 2014 Author Report Share Posted August 19, 2014 tryspecial folder and use Application will use application folder and any other folder within if not work then set path first in a variable TC I tried that, both methods you stated. Didn't work. I used this directly, and set it as a variable, didn't work either way. (application special folder)/images/image.jpg Any other ideas? Quote Link to post Share on other sites
UBotDev 276 Posted August 19, 2014 Report Share Posted August 19, 2014 I think you are having problems because you are using "load html" command. Instead you should store your HTML to a file and load it with navigate command (for some reason "load html" won't load images, had this problem a while ago). I've just tested this and it loads the HTML and it displays the image.EDIT: here is a screenshot, since for some reason I wasn't able to paste the code here (I think that string that starts with file:... prevents that): https://db.tt/SUT5IlBN Btw, if nothing works for you can still convert images to "base64" and embed them directly. Here is an example: http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/ 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 19, 2014 Report Share Posted August 19, 2014 I think you are having problems because you are using "load html" command. Instead you should store your HTML to a file and load it with navigate command (for some reason "load html" won't load images, had this problem a while ago). I've just tested this and it loads the HTML and it displays the image. Btw, if nothing works for you can still convert images to "base64" and embed them directly. Here is an example: http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/that is cool...I'ma try this on some bloggers you can also navigate to the file path addamroy can we see exact code please? Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted August 19, 2014 Report Share Posted August 19, 2014 yep this code works set(#fp pic, "{$special folder("Desktop")}\\Penguins.jpg", "Global")set(#pic to b64, $plugin function("File Management.dll", "$image 2 base64", #fp pic), "Global")load html("<img src=\"{#pic to b64}\" alt=\"beastie.png\" />") File Management is free plugin http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/ TC 1 Quote Link to post Share on other sites
nicolai 4 Posted January 15, 2016 Report Share Posted January 15, 2016 yep this code works set(#fp pic, "{$special folder("Desktop")}\\Penguins.jpg", "Global")set(#pic to b64, $plugin function("File Management.dll", "$image 2 base64", #fp pic), "Global")load html("<img src=\"{#pic to b64}\" alt=\"beastie.png\" />") File Management is free plugin http://www.ubotstudio.com/forum/index.php?/topic/13237-free-file-management-plugin-multiple-commands-and-functions/ TCAlso worked for me. Very good plugin. Thanks OP. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.