pcnico...@freesurf.fr wrote: > Hi > > I need a very simple web page to upload files on my Apache web server. > I found some cgi script like this one > http://www.raditha.com/megaupload/ but I always face "internal server > error" message. > > Did anyone done some like that ?
I had an application like this myself a while back... I found an application called "file upload" by Jeffery Carnahan. GNU license, and currently seems to be proof that GNU does NOT mean "can't disappear". Danged if I can find the original source on the 'net. Original domain has been abandoned and grabbed by a squatter. Lots of references to it...but can't find a mirror. (I only spent a few minutes looking through google, admittedly) The good news is I found what I Think is all three original files on an archival copy of one of my old machines, unfortunately the .tar or .tgz file is missing (why keep it? I could always download it again!) and I've stuck it on one of my machines. It is a whopping 9k in size, so I don't think it will hurt my DSL line too badly... :) So...file-upload.cgi, upload.html, and a README file from Jeff Carnahan, Copyright 1996 - 1998 (his, not mine!) can be grabbed here: http://www.holland-consulting.net/upload.tgz if you find any files are missing, let me know, I'm sure it is on one of my systems..somewhere. Anyway..relatively easy to get working. Needed no other packages, just uses perl (included with base OpenBSD). I didn't use a chroot on the uploading task, as it was writing to disk and on a dedicated machine, figured it wouldn't be worth the false sense of security and complexity. If you find any security issues with the app, let me know, though, the app I wrote was pretty nifty... One quirk I found, but didn't really understand, is it appears to write a temporary file to /var/tmp, then after the upload is complete, it copies it to your destination directory (imagine my surprise with my /var partition filled, when I thought it was all in my /var/www partition! :). This proved to be a little strange to the users when using a slow machine to gather big files -- the user uploads a 1G file, the upload is complete, but the thing just sits there for a minute or so as it copies the file to its ultimate destination. I didn't understand the script as well as I'd like to, but it did work, and worked quite nicely for me. Note: it would be wise to remember my role with the OpenBSD project is documenter, not code quality person, so do NOT put too much faith in my recommendation here! This script could have security holes big enough to drive a Windows Vista workstation though..use at YOUR own risk, etc. I just spent too much time trying to find something like this that worked well and simply enough that it could be maintained easily...and this did it much better(=easier) than the several other things I looked at. Nick.