can you help me with access to local reseources?
For example I want glob my images outside of www folder. PHP has access but chrome not show this images.
Thanks for your answer.
Martin
Browser cannot access anything outside of the www/ directory, but PHP scripts can access the whole file system. You can output images through a PHP script, see for an example:
Output an Image in PHP
What you're trying to achieve is possible with PHP Desktop and it is quite easy. In PHP Desktop you have full access to the filesystem in PHP scripts and you can replace the native "Choose file" dialog with your own custom implementation using PHP and js/jquery scripting. You could reuse or base your code on some existing PHP library that allows you to browse files,
see https://tinyfilemanager.github.io/demo/.
Or just do something simple, I think implementing a custom "Choose file" dialog with jquery and PHP is a matter of a few hours.
Related
I'm creating a little project in HTML and there's something that I would like to do.
Imagine that my HTML page is hosted, and you can download there some .ppt and .exe files and place to a specific folder.
Now, that's the problem. Considering that the files are in the right folder, I would like to run these files when the user select their respective options at the HTML page.
Does anyone know how to do it? Thanks :)
This isn't directly possible, for security reasons.
If you control that application or can install something on the user's system, you can associate a file type or URI handler with the application you wish to launch.
I have been reading tutorials and guides concerning this but have not found a straight forward answer to this.
I currently have an existing website running on a node.js platform, locally on my computer.
Goal: Now I want to try and write a simple hello world in Dart, export it to plain JavaScript and see it work in my existing website.
Reading the documents, I read that I should create a new "Web Application" and to create some sample code up and running, I check the "Generate sample content" box.
And my project is now created in Dart Editor:
I can run the sample in Dartium, see it work, etc.
But the problem is that I have now a .html file in the Dart-project, while I have a real .html file for my existing node website in a totally different path. I don't want that. I want to try and use the existing .html instead, since.. thats my real website.
But when trying to create a new Dartium launcher, I can only refer to .html files within my Dart-project:
So my big question is; How do actually start using Dart with my existing developed website?
How do I create that bridge?
On the second image above in your original question, there is an option just below the HTML file, called URL - is this what you're looking for? You can set that to any arbitrary URL.
You'd also need to copy the helloworld.dart file into your node.js server path, and copy the bits inside the <body> tag into your existing HTML page. You'll also need to copy the packages\browser\dart.js file somewhere to your node.js server, too.
If you wanted to run the JS version, you'd also need to use the editor menu option to Generate JavaScript and copy the .js files into your node.js server path.
The script tag that refers to dart.js automatically detects if the browser supports Dart natively, and will either load the .dart version of your app, or the .dart.js version of your app (from the same folder location).
So what you're likely after is something like:
c:/nodejs_server_root
/existingIndex.html // containing the two script tags from helloworld.html
// and other tags referred to in helloworld.dart
/helloworld.dart
/dart.js
/helloworld.dart.js
And in the "URL" path in the launch configuration, you'd put something like http://localhost:<port>/existingIndex.html
https://pub.dartlang.org/packages/dev_compiler can compile Dart to Node.js modules with the --modules=node option.
See also https://github.com/dart-lang/dev_compiler/issues/291#issuecomment-176687849
I am currently beginning a project where we want to build an Interactive Whiteboard (educational activities) and deploy via CD-ROM. I want to build the project in HTML5 for it's interactivity and then somehow compile it to both .exe. and .dmg so when the CD-ROM is inserted it autoplays the 'Game'.
How is this possible? Any help/advice would be greatly appreciated. Thank you.
I already made a project using pure C (WinAPI) on github that can pack HTML files into single EXE using resources.
http://github.com/dns/WinAPI-Embed-Browser/releases
Use: res://programname.exe/test.html as path to access html files from your EXE file.
From here you also can hide the window border & just showing the content of your HTML app, or even running on fullscreen. This is very useful if you want to make interactive CD-ROM.
On Mac, you can use Delphi/Lazarus TWebBrowser control to load html files. However I don't know if mac program can access files from resource or not.
HTML 5 is a browser technology, so I think as long as the pc you are installing on has the latest browsers, installing your app should work fine.
Can you tell us why you want it as a CD-ROM based installation, where as you can easily host it online?
You may not need any .exe wrapping. Here is an approach.
Important: your autorun will be often disabled, [not so] quietly. Provide some instructions for running your application manually.
So:
Google for running a portable version of Firefox or Chrome from a CD. Have the browser prepared. Put it in a [sub]directory representing your CD.
Put your content there.
Create a .cmd file to invoke the browser with a command like,
FirefoxPortable.exe index.html
Create autorun.inf (details googlable) to call the above batch file.
Make a CD image from that directory. There are lots of CD burning applications that can do that.
Test.
I have a VBScript script file saved as a .vbs on my desktop: pastebin.com/Nhj5Rs0j
Can I take this and put it in a HTML file to upload to my website via FTP?
I tried to do this on Internet Explorer and I clicked allow active content. I get done, but with an error on the page (I just realized this).
Can I recreate these events using a .hta or some other programming language?
What can I possibly do to achieve my goal?
There is nothing wrong with VBScript in the browser (IE only, ofcourse), but the script you provided in the pastebin will never work, because it is a script for Windows-based Scripting Host environment that is only executable in the OS itself and not in the web browser.
Given a simple HTML file is there any difference when testing, in opening it directly by double clicking it or uploading to IIS/Tomcat and accessing localhost/simpleHTML?
In the case of html files it dosenot matter much. Where this matters is when the page is made in languages like php, jsp etc. A webpage containing php or jsp files will not be detected by browsers when directly opened. For this we use webservers like wamp, xampp, lamp, tomcat etc and acces it via localhost/pagename. For more details just view the pagesource of a php file. You wont be able to find and php scripts in it. You will be able to see only the html part in the page. For scripting languages like html, javascript, css etc. opening directly dosent matter.
Hope this is useful to you.
No, a simple HTML-only file will not be rendered differently most(99.9%) of the time by opening it directly by double-clicking from the local file system and accessing it from a web server. The only difference will be caused if the file contains any server side language (PHP, ASP etc..)