Forum Moderators: phranque

Message Too Old, No Replies

Question related to Apache & Htaccess

         

mikewalterz

9:42 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



Hello,
I have a question. I want to allow users to have ftp access (server apache) but make it so that they can only upload a certain type of file (html).

Is this possible with apache & ftp (cpanel)? Is there a way to do this with htaccess?

Any good ways to do this?

Thanks
Mike

phranque

10:45 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



htaccess applies to the http protocol, not the ftp protocol.
i think you can only do this with file permissions.

mikewalterz

10:47 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



What would the permissions have to be?

phranque

11:32 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



assuming *nix here:

if you are using regular ftp, the ftp user's login and password are applied as usual to file and directory permissions.
so you would need to make non-.html files unreadable by the "these" users.

if you are using anonymous ftp, the default anonymous ftp directory and all its subdirectories will be available for download.
so you don't put non-.html files or links to non-.html files here.

mikewalterz

11:41 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



Kk. Is this the only way to do it? Is there no way to manipulate ftp through scripting / anything else?

Thanks for your help!
Mike

TXGodzilla

11:55 pm on Feb 15, 2007 (gmt 0)

10+ Year Member



The feature you want to change is configured in the server ftp daemon and doesn't have anything to do with Apache. Depending on the ftp server software you can define groups and restrictions.

You would either have to have root access on the server or a very cooperative hosting company to make the configuration change.

Since you are only dealing with html files, you could setup a PHP "file upload" alternative.

phranque

12:27 am on Feb 16, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



txg:
i was assuming mw was referring to apache's ftp server, but maybe i'm the confused one here.

mw:
regardless of the ftp server, i think txg's suggestion of a http/script-based solution is probably best here.