Running linux commands through html

819 views Asked by At

I want to create a basic html file that has an upload button for 3 files that are in a folder(.bed, .bim, .fam), and a convert button to convert those input files into another file (.ped, .map)

I am successful to do this conversion in the terminal by using:

plink --bfile inputFile --recode --out newFile

http://zzz.bwh.harvard.edu/plink/

The issue is how can I make the convert button in the html file run the script above to do the conversion and send the converted file back to the webpage ... because I have to use plink to do the conversion...

Thanks and any help is much appreciated !!

:)

1

There are 1 answers

1
Quentin On

There is no way to do this directly.

The closest you could come would be to run an HTTP server and write a server side program (e.g. via Perl + PSGI + FastCGI, Node.JS + Express or even Bash + CGI) which acted as a wrapper around those commands.

You could then have an HTML document include a <form> which, when submitted, would trigger the HTTP request that would cause the server to run that program.