Creating a "Drop Box"


#1

Ok, ok… I’ve been doing a bunch of research, and even though all signs point to no, I still have to ask.

I am looking to set up a browser based, “drop box” type script that will allow uploads to a specified folder on my FTP. I am no stranger to web design, and I do have a PHP script that achieved this goal, although it appears as if the upload limit for PHP on DreamHost is 7mb (please correct me if I am wrong).

Now, it seems easy enough. It really seems as if this would be a simple thing to do, either with PHP or without. I cant set up an anonymous FTP (yet) as I do not have the right package for that - although I am seriously considering upgrading to the Code Monster package just to get anonymous FTP…

But, say I did have anonymous FTP - would that allow me to create a “drop box” of sorts on my server? Would I just need to adjust the permissions appropriately?

I’d really like it to be a web based drop box, but if I have to settle for an anonymous FTP account, I will.

If anyone can shed some light on this for me, I would be very grateful.

Thanks!!

  • Joe C.

#2

On a shared server, CGI processes are limited to how long they will run. You can use Perl or a self-complied PHP for example to break the 7mb limit, but then it depends on how long the upload takes.

:cool: Perl / MySQL / HTML+CSS


#3

This page from php.net gives complete instructions for how to create an HTML upload form and the PHP script to process it. You can even put them on the same page and have the form action reference itself. It works pretty much as-is on DH’s servers; you don’t need anonymous FTP or any over-the-top permissions configuring.

You would want your upload directory ($uploaddir in php.net’s script) to be something like: /home/username/uploadsfolder/. You definitely don’t want it to be in a web-accessible directory for security reasons, and if you’re only accepting one type of file (i.e. images) you’d probably want to implement server-side checking to verify that the file uploaded is indeed legitimate before saving it to the server.