cgi

Create an upload form, select a folder and get a specific file in folder

Hi, To upload a single file, it is very simple to use this HTML script: <p> <input type="file" name="input.txt" /> In this question, my task is to select a folder and then get the input.txt inside that folder. The server will response whether input.txt is available or not and to upload it to web server. Is there any way to select...

How to enable 'wget' to download the whole content of HTML with Javascript

I have a site which I want to download using Unix wget. If you look at the source code and content of the file it contain section called SUMMARY. However after issuing a wget command like this: wget -O downdloadedtext.txt http://www.ncbi.nlm.nih.gov/IEB/Research/Acembly/av.cgi?db=mouse&amp;c=gene&amp;a=fiche&amp;l=2610008E11Rik ...

Best way to password protect a folder?

I am trying to create a similar way to Cpanel password protect directory, where a pop up comes out asking the user for a username and a password, but Cpanel way is amazing but my client doesn't know anything on how to do that, so i wanted to create a pop up msgbox informing the visitor to enter a user name and a password, and i totaly co...

Problems with Routing URLs using CGI and Bottle.py

I've been having difficulty getting anything more than a simple index / to return correctly using bottle.py in a CGI environment. When I try to return /hello I get a 404 response. However, if I request /index.py/hello import bottle from bottle import route @route('/') def index(): return 'Index' @route('/hello') def hello(): ...

How can I force mod_perl to only allow one process per connection?

I have a perl cgi script that's fairly resource intensive (takes about 2 seconds to finish). This is fine as long as only at most 4 or 5 of them are running at the same time and that's usually the case. The problem is that when a user clicks a link that calls this script, a new process is spawned to handle that connection request, so if...

How can I run an external process without waiting for it to finish from a Perl CGI script?

Is it possible to continue displaying a CGI script's HTML without waiting for a child process to complete, yet the child process should stay alive when the CGI script is complete. Here's what I have, -- Display HTML page # html page set up... so header/other stuff #the -c, -h are params are just params system("perl subproc...

Python CGI Premature end of script error depending on script parameters.

I have a python script which should parse a file and produce some output to disk, as well as returning a webpage linking to the outputted files. When run with a file posted from the HTML form I get no HTML output back, just a 500 error page and the error_log contains the line: [Mon Apr 19 15:03:23 2010] [error] [client xxx.xxx.121.79] P...

XAMPP Mercurial installation on Windows Apache --> HgWebDir.cgi Script Error

I try to publish multiple existing mercurial repository-locations though XAMPP Apache via CGI Python script hgwebdir.cgi ... as in this tutorial http://mercurial.selenic.com/wiki/HgWebDirStepByStep I get the following error from the apache error logs, when I try to access the repository path with a browser: Premature end of script head...

Reading a client's header from Python CGI script?

I'm writing a very simple web service, written in Python and run as CGI on an Apache server. According to Python docs (somewhere... I forgot where), I can use sys.stdin to read the data POSTed by a random client, and this has been working fine. However, I would like to be able to read the HTTP header information as well - incoming IP, u...

Using Python as a CGI script without the CGI module?

Is it possible to use Python as CGI without using the CGI module and still get access to all of the browser information and everything? I tried: #!/usr/bin/python import sys print "Content-type: text/html" print data = sys.stdin.readlines() print len(data) but it always prints 0. ...

How do I set Perl's @INC for a CGI script?

I have the follwing, simplest Perl CGI script: use strict; use warnings; use CGI(); use CGI::Carp qw(fatalsToBrowser); use Template; print CGI::header(); foreach(@INC) { print "$_\n"; } When called (http://[..]/cgi-bin/p.cgi) I am given the following error: Can't locate Template.pm in @INC (@INC contains: /usr/lib/perl5/site_p...

How to call cgi script from ruby

Hello, I've a remote cgi script hosted on Apache using SSL. It takes in two input variables a and b. I want to call call the cgi script with right input variables using ruby. Any clues would be appreciated. ...

Ho to get PHP setrawcookie value back?

The IETF recommends to use base64 encoding for binary cookie values. http://tools.ietf.org/html/draft-ietf-httpstate-cookie-07 So I use setrawcookie(..) but I don't know what variable to use to get the cookie back because $_COOKIE[..] still uses the URL decoding that matches setcookie(..). This replaces "+" with " " in the output. <?ph...

How to embedd cgi in html

I have no problem executing a cgi file under the normal url like this: http://www.myhost.com/mydir/cgi-bin/test.cgi However when I tried to embedd it into HTML file (called index.html) like this: <HTML> <BODY> <P>Here's the output from my program: <FORM ACTION="/var/www/mydir/cgi-bin/test.cgi" METHOD=POST> <!-- This does...

How do I include a frameset under CGI.pm?

I want to have a cgi-script that does two things. Take the input from a form. Generate results base on the input values on a frame. I also want the frame to exist only after the result is generated/printed. Below is the simplified code of what I want to do. But somehow it doesn't work. What's the right way to do it? #!/usr/loca...

What is a good Perl CGI tutorial?

I am going to learn Perl CGI. Please suggest a good URL or book for a CGI tutorial. ...

How can I get file size in Perl before processing an upload request?

I want to get file size I'm doing this: my $filename=$query->param("upload_file"); my $filesize = (-s $filename); print "Size: $filesize ";` Yet it is not working. Note that I did not upload the file. I want to check its size before uploading it. So to limit it to max of 1 MB. ...

Is there a list comparing the features of different frameworks available for developing web apps in Perl?

I've recently been learning perl and am wondering what frameworks are available for creating a web app. I'm mostly concerned about security, so if there are any security-specific web frameworks you'd recommend, I'd be more interested in those. Currently accepted answer from thread below ...

How do you run a uncompiled CGI?

I'm going to get right to it. iPage shared hosting. Trying to use mimetex.cgi to render math. Source code is at the link. After preparing everything just as I had with a different shared host (which worked), I get errors. Tech support tells me I need to upload the uncompiled source and use that instead. ??? Rather than going with th...

Can I use Catalyst to display images or graphs?

I have simple Perl/CGI scripts based web server which is mainly used to display graphs and images. I am looking to make it more technical and come to know about Catalyst. I have installed all the required Perl modules on my test platform and created an application called myweb. Also, I am going through the Catalyst documents to reach my ...