OtagoHarbour Posted April 30, 2011 Share Posted April 30, 2011 I would like to write a script that:1/ Puts up a browser window to get the name of a file.2/ Runs a function in a C++ static library that is stored on the disk and passes the name, from step 1, as a character string parameter to the function.I've gone through the html, JavaScript and PHP tutorials but am still unclear about what function to use to run a browser and get the name of the file of interest. I also do not know how best to attack step 2.Thanks,Peter. Link to comment Share on other sites More sharing options...
jeffman Posted April 30, 2011 Share Posted April 30, 2011 What you're discussing is so incredibly insecure that I doubt most browsers will support it. (Specifically, they won't give you a file path, and they won't let you execute files.) Older versions of IE might have something. I'm not sure about IE8-9, because lately Microsoft has been getting more on the ball. Link to comment Share on other sites More sharing options...
Ingolme Posted April 30, 2011 Share Posted April 30, 2011 You can't get the name of a file that's on the client's computer without uploading it. This tutorial explains how to upload a file http://w3schools.com/php/php_file_upload.aspI believe exec() allows you to run executables on the server machine. Link to comment Share on other sites More sharing options...
OtagoHarbour Posted April 30, 2011 Author Share Posted April 30, 2011 What you're discussing is so incredibly insecure that I doubt most browsers will support it. (Specifically, they won't give you a file path, and they won't let you execute files.) Older versions of IE might have something. I'm not sure about IE8-9, because lately Microsoft has been getting more on the ball.You are right of course. I should have thought of that. Thanks. Actually the library function processes a set of files so the name of the input file is the name of a file containing a list of the files to process. Perhaps I could allow the user to upload the files in their set, name their set, and subsequently select the name of the set for processing from a pull-down menu.What would be the best way to run the function from a C++ library file on the browser?Thanks again,Peter. Link to comment Share on other sites More sharing options...
OtagoHarbour Posted April 30, 2011 Author Share Posted April 30, 2011 You can't get the name of a file that's on the client's computer without uploading it. This tutorial explains how to upload a file http://w3schools.com/php/php_file_upload.aspI believe exec() allows you to run executables on the server machine.Thanks very much! I will check them out. Link to comment Share on other sites More sharing options...
OtagoHarbour Posted April 30, 2011 Author Share Posted April 30, 2011 I believe exec() allows you to run executables on the server machine.Unfortunately, that does not appear to be what exec() does.http://www.w3schools.com/jsref/jsref_regexp_exec.aspThanks,Peter. Link to comment Share on other sites More sharing options...
birbal Posted April 30, 2011 Share Posted April 30, 2011 thats exec() function is not the javascript exec() function. there is another function in php exec() Link to comment Share on other sites More sharing options...
thescientist Posted May 2, 2011 Share Posted May 2, 2011 Unfortunately, that does not appear to be what exec() does.http://www.w3schools.com/jsref/jsref_regexp_exec.aspThanks,Peter.he meant the PHP function, not the javascript regex method. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.