LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-25-2012, 09:29 AM   #1
imran042
Member
 
Registered: Feb 2012
Posts: 35

Rep: Reputation: Disabled
A simple form upload-script example using #!/usr/bin/perl.


Any one who can show me a simple starting perl form upload script
 
Old 04-26-2012, 09:43 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imran042 View Post
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.
 
Old 05-01-2012, 01:58 AM   #3
imran042
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
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....
 
Old 05-01-2012, 10:07 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imran042 View Post
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.
 
Old 05-01-2012, 11:59 PM   #5
imran042
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-02-2012, 10:23 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imran042 View Post
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.

And don't post the same question in multiple threads. Same answers were given here:
https://www.linuxquestions.org/quest...alhost-942718/

Last edited by TB0ne; 05-02-2012 at 10:24 AM.
 
Old 05-03-2012, 12:45 AM   #7
imran042
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
where is the cgi-bin directory located in ubuntu11.04
 
Old 05-03-2012, 01:08 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imran042 View Post
where is the cgi-bin directory located in ubuntu11.04
Wherever you set it to be when you installed Apache. Usually one directory level up from where your htdocs are stored.
 
Old 05-03-2012, 03:06 PM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by imran042 View Post
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?
 
Old 05-03-2012, 03:12 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 05-03-2012, 08:18 PM   #11
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Maybe this: http://search.cpan.org/~hank/Form-Pr...m/Processor.pm is a good start - there are links to other related modules.
 
Old 05-04-2012, 06:20 AM   #12
imran042
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
right said, this is programming. and i directly downloaded apache from command line,
without any interruptions or options
 
Old 05-06-2012, 09:49 AM   #13
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 05-06-2012, 11:27 PM   #14
imran042
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-08-2012, 07:58 AM   #15
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.

--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Cannot find 'ssh-keygen' in '/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin' venu.navat Linux - Software 3 03-08-2012 04:00 AM
slackware 13.0 32bit the "/usr/bin/sha1pass" perl script can NOT run ginkgo Slackware 3 03-05-2010 05:00 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
local versus /usr/bin why, howto (Perl) acummings Linux - Software 6 03-02-2005 01:14 AM
.CGI scripts enabled with #!/usr/bin/perl -i?? computerdaves Fedora 8 02-18-2005 04:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration