LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 02-14-2003, 01:08 AM   #1
chens_83
Member
 
Registered: Dec 2001
Location: Adelaide , South Australia
Distribution: redhat 7.2, Debian , OpenBSD
Posts: 123

Rep: Reputation: 15
uploading with apache and php


i have a apache 1.3x server with php enabled. My question is i am trying to upload with apache and without the use of FTP. Now i am doing this because i can only access WWW ports through my schools firewall/proxy.

Do i somehow need to enable the POSTing function / PUTting ? Once i hit my submit button there are no error messages , just no file uploaded

is there a better way of doing this ? Or is there a better package?
 
Old 02-14-2003, 09:41 AM   #2
Wolven
Member
 
Registered: Jan 2003
Posts: 195

Rep: Reputation: 30
What are you using to upload? PHP tool or something?
 
Old 02-14-2003, 12:00 PM   #3
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
Yeah, I'd like to see the server side code that is supposed to receive this file. But make sure you have a multipart form to enclose your file element. When you are uploading files, POST is always recommended over GET. In GET, the file will be part of your URL ( which in turn is part of the HTTP header and hence has length restrictions ) whereas with POST it is part of the http data, which presents no length limits 'theoretically'.

<form name="dummy" enctype="multipart/form-data" method="post">
 
Old 02-14-2003, 07:24 PM   #4
Scrapz
LQ Newbie
 
Registered: Feb 2003
Location: Brisbane, AU
Distribution: Gentoo
Posts: 20

Rep: Reputation: 0
I just recently aquired a perl script that does web-browser uploads. Its a nifty script which requires a username (seperate from the system) and password, so unauthorized uploads arent allowed, but you could always make an 'upload' username and publicize it.

Any way, get upload.txt and mycrypt.txt, put them in your cgi-bin dir of your webserver, rename them to .pl and make them executable (chmod 755 *.pl). Run the mycrypt.pl script with the password as the argument (./mycrypt.pl myPassword [it is case sensitive]) and it will return what looks to be random text (ie: xyP2.ek86.dO) - create a new file in your cgi-bin dir named upload.db and put one line username|encryptedPassword|/dir/to/upload/dir and there you have it. Test it by typing http://127.0.0.1/cgi-bin/upload.pl and uploading a file. Make sure that the directory you're uploading to has world write permissions, otherwise it will error saying it cant write to the dir.

I got all this information from http://www.muquit.com/muquit/softwar...upload_pl.html - but I use it myself and it works

TTFN,
Scrapz

Last edited by Scrapz; 02-14-2003 at 07:26 PM.
 
Old 02-15-2003, 07:50 AM   #5
chens_83
Member
 
Registered: Dec 2001
Location: Adelaide , South Australia
Distribution: redhat 7.2, Debian , OpenBSD
Posts: 123

Original Poster
Rep: Reputation: 15
yeh i havent actually written these tools, anyways i havae been looking on freshmeat and found some stuff. Thanks anyways
 
Old 02-15-2003, 10:10 AM   #6
chens_83
Member
 
Registered: Dec 2001
Location: Adelaide , South Australia
Distribution: redhat 7.2, Debian , OpenBSD
Posts: 123

Original Poster
Rep: Reputation: 15
ok now , im taking the thread a little of track. Iv been trying to setup php4 so that it can handle php3 content . I have setup the AddType part of my httpd.conf but i am getting a weird error. It is trying to save something is my upload/download phpon my HDD. If i save the file and have a look it is my php upload/download script.

I also was having trouble like when it was displaying my php pages i was actually seeing the code instead of the processed html
 
Old 02-16-2003, 05:09 AM   #7
Scrapz
LQ Newbie
 
Registered: Feb 2003
Location: Brisbane, AU
Distribution: Gentoo
Posts: 20

Rep: Reputation: 0
That would probably mean you either dont have PHP installed, or dont have it enabled. You can find if you have it installed by typing 'php -v' at the console, and you should get something along the lines of:

PHP 4.3.0 (cli) (built: Feb 16 2003 00:19:13)
Copyright (c) 1997-2002 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies


If you have it installed, then it is not enabled for Apache. You can test it by (first making sure Apache isnt running) then typing apache -D php4 (as root) then accessing your PHP page. A good and simple way of doing it is to create a .php file with a single line of code: '<? phpinfo(); ?>' - that should make lots of nice information for you, if it doesn then theres something wrong with your PHP installation and you need to give it another go, keeping an eye out for any errors.

If it does work, then you need to add the '-D php4' argument to your apache init script so it starts like that everytime. Now I dont know what distro you're running, but if theres an init config file for Apache (for example, in Gentoo theres /etc/conf.d/apache) then there should hopefully be an example in there to show you how to format it (ie: APACHE_OPTS="-D php4")

TTFN,
Scrapz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading multiple files with php dizzutch Programming 0 01-04-2005 04:29 PM
PHP and File Uploading Tomasfuego Linux - Software 6 08-12-2004 09:20 AM
Error uploading file with PHP jacksmash Programming 8 11-22-2003 11:11 AM
uploading php on free server?? farhan Linux - General 1 04-24-2003 04:45 AM
PHP and uploading files Syncrm Linux - General 5 07-02-2002 11:49 AM


All times are GMT -5. The time now is 07:58 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration