[SOLVED] A simple form upload-script example using #!/usr/bin/perl.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Any one who can show me a simple starting perl form upload script
Google can show you. Try there first...plenty of examples can be easily found.
If you have a specific problem/question with your code, we'll be happy to help. But, based on your other threads, I'll not be looking things up for you.
i have installed apache2 and by entering 127.0.0.1 or type localhost in the browser it shows, 'it works'.
now my apache 2 is running, but after i create a file upload form using perl and i want to veiw it using 127.0.0.1, how do i do it
apache is totally new to me
please a good detailed answer will surely help me....
i have installed apache2 and by entering 127.0.0.1 or type localhost in the browser it shows, 'it works'.
now my apache 2 is running, but after i create a file upload form using perl and i want to veiw it using 127.0.0.1, how do i do it
apache is totally new to me
please a good detailed answer will surely help me....
And a good, detailed QUESTION would help us answer you. Saying you're using a perl program and want to 'view' it, tells us nothing. What content are you creating with the perl program? How do you want it displayed?
At this point, this is NOTHING to do with Apache...this is a question about web-programming, and rendering content. I suggest you start by looking into html/php programming how-to's (again, start with Google), and figure out what it is you want to accomplish. There are THOUSANDS of sample pages/scripts/programs you can easily find.
i want to veiw my html form script or my perl form script at the localhost.
and the answer, if i move my perl form upload script or html form script to /var/www, i can veiw it at local server by 127.0.0.1/filename.
how is it.
Still no idea what you're trying to do. If all you want to do is view the contents of a text-file (a perl script in this case), and you already CAN view it by entering the file name, what's your question?? AGAIN, if you want to EXECUTE the file, you need to put it in your cgi-bin directory.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by imran042
i have installed apache2 and by entering 127.0.0.1 or type localhost in the browser it shows, 'it works'.
now my apache 2 is running, but after i create a file upload form using perl and i want to veiw it using 127.0.0.1, how do i do it
apache is totally new to me
please a good detailed answer will surely help me....
Why are you doing this? What are you hoping to accomplish by using this upload form?
I think people are troubled by the ambiguity in your question.
"i create a file upload form using perl and i want to veiw it".
There are many things that the question can mean, depending on what and how you want to view. The usual case for a combination involving Perl, Apache, upload forms, and viewing is that you have a Perl script which generates an HTLM form that allows an HTTP client (web browser, typically) to upload upload one or more files to a web server. In such a case, the Perl script is normally installed in the cgi-bin directory of a suitably configured Apache web server. A browser then fetches the HTML form by requesting the cgi-bin URL (you Perl script) from the web server (doesn't matter whether the URL is on localhost). The Perl script then replies with an HTML form that allows the user to specify files to upload. The browser then submits the form, and the same or another Perl script handles the file upload.
If this is not the scenario that you are trying to understand, then please clarify for us. If this is the correct scenario, then as others have posted, Google can easily find many examples of how to do this, with explanations that clearly describe the related details.
--- rod.
thanx, thats the same thing i've been looking, as many tutorials i didnt found apache2 tutorials in details, so....
shall the html scripts be saved in /var/www to run it,in the browser and the perl script in the cgi-bin.
i need some help an guidings, plz will u help me in fetching knowledge over apache
---------- Post added 05-07-12 at 09:57 AM ----------
thanx, thats the same thing i've been looking, as many tutorials i didnt found apache2 tutorials in details, so....
shall the html scripts be saved in /var/www to run it,in the browser and the perl script in the cgi-bin.
i need some help an guidings, plz will u help me in fetching knowledge over apache2
Yes, you store your HTML files (these are not scripts) in the /var/www, and Perl and other CGI scripts in /var/www/cgi-bin. The Apache web server can optionally be configured to use other directories, but I believe these are the current standards. Your Perl scripts do not store HTML files, but rather output them to their standard out stream, where the server relays them to the connected browser. There is little or nothing about any of this that is Apache-specific, so focusing your research on that will limit the results. I did a Google search for "perl cgi upload file example", which yielded a good number of promising results. If you need help on specific Apache matters, the Apache web site should be your best resource.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.