View Full Version : Accessing programs in CGI

06-12-2002, 11:50 AM
One of the main reasons I'm doing my project with CGI and not Java (with exception to Servlets) is so that I could access files on the users computer. Now, if I have a cgi program and I reference, lets say c:\CGIASM\myfile.asm to write or load it, is that going to be referring to the user's computer? or the servers computer? If it is the server, does anyone know how to force it to refer to the users program? The user will be selecting the file, so does that change anything?

06-12-2002, 03:17 PM
When your program is loaded by the client (in say its browser) you can work with HTML, various scripts, applets and stuff like flash movies, but none of these can directly affect files (there are alternatives to the previous like ActiveX, but I doubt if that's what you want)

If you want the user to be able to submit files, do something like

<FORM ACTION="http://MyDomain.com/MyCGIProg" ENCTYPE="multipart/form-data">
Upload your ASM file
<INPUT TYPE="file" NAME="Upload_Name">

That will allow your server to recieve files from a client computer.....You just need to decode it and do whatever...

06-12-2002, 03:59 PM
Well that pretty much means that my project that I planned for the entire summer won't work.... darn.. CGIASM is no more.

06-12-2002, 04:06 PM
If I understand, you want to write an ASM compiler online...

Well just have the person type up their code in an input box, and when they hit "assemble" then just have your program take that data from the box, assemble it, and write it to the users computer as a cookie...then you can tell the person to grab it from their cookies folder and rename it to an exe.

06-12-2002, 04:11 PM
Well I considered that - but I really wanted this to run stand-alone so that it would function like a regular compiler.

06-13-2002, 01:54 AM
Sorry......I dont see it would be too bad....

The user writes his/her .asm file/files.......Clicks the browse button on the html page you provide......a file dialog comes up.......they select the file......click submit......your program assembles into .obj files or whatever.....the files are sent back for the user to download....they do the same for linking......the exe is then sent back for download......

Not too bad.....