Linux - GeneralThis 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
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.
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?
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
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'.
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.
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
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")
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.