Closed Thread Icon

Topic awaiting preservation: Giving someone FTP-like access to a subdirectory of my site through a PHP script... (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12833" title="Pages that link to Topic awaiting preservation: Giving someone FTP-like access to a subdirectory of my site through a PHP script... (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Giving someone FTP-like access to a subdirectory of my site through a PHP script... <span class="small">(Page 1 of 1)</span>\

 
kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 07-24-2003 14:58

Hi everyone!

I'm thinking about giving a few MB of my webspace to a friend of mine for him to have an ad-free place for a small site, but as I'd rather not give all the FTP details to him and my host won't let me set up another FTP user for the directory his pages are going to live in I am now looking for a PHP-driven way of giving him access to this one directory. Ideally, he would be able to upload/download/delete files and create/delete subfolders as he wants in there.

Has anyone done this before and can point me into the right direction or share a good link to an article about this (or even a pre-made script)? I'm off googling some more - any clue you might have would be much appreciated!


kuckus

trib
Paranoid (IV) Inmate

From: Den Haag, Netherlands
Insane since: Sep 2002

posted posted 07-24-2003 16:02

I can give you the whole code .. already written and tested if you like .. it's a bit long-winded to go into over the forum, but I've zipped it up and put it here (zip removed because of heavy traffic) if you want it ... I know you can code pretty well, so I'm sure you'll have no problem picking through it, tidying it up, and changing the variables to match your own setup.

The login routines are pretty piss-poor. I never got around to writing the user authentication part so the uid and passwd are in text in the code, but for one user it's OK, and I know you'll fix it if you feel the need anyway. If you want to extend it for multi-user access you'll need to sort out a mySQL dB with username/password/"home" directory details in it. Either that, or give each of them their own copy of the programs ... and put their data directory elsewhere (pretty scruffy solition!!)

It only permits access to a tree BELOW a named "root" directory, and permits upload, delete, rename and view file ops and chdir directory ops. I never got around to mkdirs but it ought to be pretty easy. There's no traversal upwards from the base dir.

Clicking on a filename will cause the browser to attempt to open it in a new window, the rest is done with checkboxes or text boxes.

I put up a demo directory on my system so you can try it out, but the password is different on mine compared with the one in the zipper, so e-mail me for the details. It's the one I was going to use as a second tutorial for the Gurus so let me know what you think of it.

(PS - Somewhere in my dev stack I have a better version which sorts out directories before files and makes the layout a lot tidier .. I'll look for it if I find the time)


Bug-free software only exisits in two places
A programmer's mind and a salesman's lips

[This message has been edited by trib (edited 07-24-2003).]

[This message has been edited by trib (edited 07-24-2003).]

kuckus
Bipolar (III) Inmate

From: Berlin (almost)
Insane since: Dec 2001

posted posted 07-24-2003 17:39

Wow, Trib, thank you *very* much, that's perfect! Exactly what I was hoping to be able to put together with some help, but getting the whole code - great.

I've downloaded the .zip and will give it another more thorough look later today. Thanks again!


kuckus

[This message has been edited by kuckus (edited 07-24-2003).]

« BackwardsOnwards »

Show Forum Drop Down Menu