LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-13-2005, 05:56 AM   #1
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Rep: Reputation: 15
Allow file upload in httpd.conf?


I would like to allow visitors on my webpage to upload files on my server, and I have a perl-script that runs it through a mailform... No problems, and I get the inputs with no errors, but there are no files in my upload-dir. I'm sure I've configured the script right.

I'm guessing that I have to configure apache to allow this?

The path is /var/www/upload and I've set premissions to chmod a+rwx on the upload-dir...

I'm using Apache 1.3.26 on an Debian....

What do I need to add in httpd.conf to get apache to allow file upload to this dir?

Thanks!

@ngelot
 
Old 05-13-2005, 07:33 AM   #2
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Just looking around for possible answers, here's what I've found...

--------------------------------------------------------------------------------------
If you are going to try and upload files through a form, always make
sure you that you set the form to allow files by adding this attribute;

enctype="multipart/form-data"

Otherwise your form field that should contain the file will be empty,
--------------------------------------------------------------------------------------

and perhaps there's something here:
http://httpd.apache.org/docs/mod/cor...mitrequestbody

Another possibility might be that permissions of /var/www, which I would not advise changing. Perhaps move the upload directory into the html directory (assuming you have the standard /var/www/html structure) and perhaps even let apache own it

chown apache:apache /var/www/html/upload

That's all the ideas I've got...

Good luck, let us know if you get it...
 
Old 05-13-2005, 08:07 AM   #3
@ngelot
Member
 
Registered: Oct 2004
Posts: 84

Original Poster
Rep: Reputation: 15
Thanks for your reply...

My form is OK, and I have no apache user...

My html root are /var/www/ where I have all my html-files, and I don't want to change any premissions here. It's only the /var/www/upload-dir I want them to upload to...

I changed the script so that the default upload path are /tmp/ and default url are http://www.mysite.com/tmp.

And then I added this in httpd.conf:
Code:
Alias /tmp/ /tmp/

<Directory /tmp/>
 Order All
 AllowOverride All
 allow from all
</Directory>
Then restarted apache..

No luck - it won't work, but http://www.mysite.com/tmp/ works fine in my browser...

@ngelot
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
2 httpd.conf file, which one is being used? newlinuxnewbie Linux - General 2 11-27-2005 04:43 PM
Apache httpd.conf file?? matux Mandriva 2 01-28-2005 09:20 AM
How to open and Editin httpd.conf file kakagak Linux - General 3 08-24-2004 12:35 PM
saving changes to apache2/conf/httpd.conf file Zaius Linux - Newbie 6 01-09-2004 11:45 PM
httpd.conf File? HappyDude Linux - Software 3 08-16-2003 12:38 AM


All times are GMT -5. The time now is 11:34 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