FTP server

Q : Hur kan jag läsa/sätta rättigheter på filer/kataloger i RaidenFTPD virtuella fil system?

målgrupp : RaidenFTPD script software authors / programmer

A : RaidenFTPD FTP server kan hantera ägarskap på fil nivå, detta är det inte många FTP servrar för Windows som kan. MEN, det var inte lätt för tredje parts program att komma åt denna information. Därför är vi glada att kunna presentera RaidenModeX Active-X control, riktad åt författare för FTP script helt GRATIS !

Steg 1 : ladda ner RaidenModeX Active-X control här

Steg 2 : Installation

Packa upp ModeX.zip till en katalog (rekommenderas att denna katalog är din projekt katalog) , registrera sedan katalogen genom att i ett kommandofönster skriva 

regsvr32 RaidenModeX.ocx

Steg 3 : Öppna ditt projekt och lägg till active-x komponenten 

Exempel för Microsoft Visual C++

Eftersom översättaren själv inte programmerar i Visual C++ så är exemplet på engelska för att undvika felaktigheter.
Since the translater doesn't use Visual C++ himself the example is in english to avoid any errors.

1.Open your project file

2.Pick any dialog resource and click the right mouse button->insert activex control

3.Find RaidenModeX Control and click OK

4.Under the same dialog resource , clicl right mouse button and launch Class wizard

5.Click the member variables tab , find the control id IDC_RAIDENMODEXCTRL1 , and click Add variable button

6.Now the MSVC will ask you if you want to generate a C++ Wrapper class for it , click YES

7.When the Add Member Variable dialog box appears , enter a proper name for it , such as m_modex

8.Now goto the .CPP source file and include the generated RaidenModeX.h header file

9.Supposing you have exported this control name as m_modex (well this is your job)

10.If you have file called xxx.zip , under e:\temp , and it was uploaded via RaidenFTPD system , there should be a .raidenftpd.acl file under e:\temp

11.To get the information of this file , simply use the component's method 'SetFilePath'

BOOL CRaidenModeX::SetFilePath(LPCTSTR fullpath)

parameter :

LPCTSTR fullpath : full path name of the file you want the active-x to get information for you , String type

return value :

TRUE if the active-x can find an entry in the .raidenftpd.acl file for the specified file , FALSE if not

ex:

m_modex.SetFilePath("i:\\temp\\xxx.zip");

 

12.After you call this method , the following properties become available

file owner , file group , file mode , free file , complete file

however you will need to use the following method to retrieve them

GetOwner(); // get the owner name of the file
GetGroup(); // get the group name of the file
GetMode(); // get the permission mode of the file (000-777)
GetFree(); // 0=count credit file , 1=free file
GetComplete(); // 0=not complete or unknown , 1=complete file (passed sfv or zip checking)
GetErrormsg(); // get error message

note : all return values are string type

13.To set the information of a file/dir , simply use the component's method 'Chmod'

long Chmod(LPCTSTR mode, LPCTSTR uname, LPCTSTR gname, LPCTSTR fullpath, short complete, short free)

parameter :

LPCTSTR mode : 000-777 , refer to this page for more info

LPCTSTR uname : 1-10 characters , the username , should not contain space character

LPCTSTR gname : 1-10 characters , the group name , should not contain space character

LPCTSTR fullpath : full path name of the file you want the active-x to set information for you , String type , wildcard in filename is allowed

short complete : 0 or 1 , if the file is tagged as complete or good file

short free : 0 or 1 , if this file will be freely downloadable by everyone without credit

return value :

always 0

ex:

m_modex.Chmod("755","john","admin","c:\temp\*.zip",1,1);

 

14.Note to the Visual Basic Users

1. Attach OCX as a component and place on form.

2. Initiate SetFilePath(path\file) method.

3. If returns TRUE, the owner, group, complete, free, mode, and errormsg properties are already updated (no need to initiate another GETXXX() method).

Calling that second methods were what I was confused about. It seems there is no need in VB to do that since the properties are auto filled if TRUE. Thanks.

Warning : License Agreements

Licensing the RaidenModeX ActiveX control for distribution
=============================================================================

The RaidenModeX ActiveX control

The RaidenModeX ActiveX control package allows you to include RaidenModeX.ocx in your 32-bit Windows applications, and to distribute these applications royalty-free if the following requirements are satistifed .

1:You can only distribute it with any software packages that supports RaidenFTPD , not including FTP server packages

2.You must notify RaidenFTPD team before you distribute this activex control

3.You must put a copyright notice for this component in your readme file or software's about page

copyright owner : (C) RaidenFTPD team , 2002

4.Absolutely no warranty , if you use it or distribute it with your software package , you agree to use it with your own risk

That's ALL

 

Copyright © RaidenFTPD TEAM , ALL RIGHTS RESERVED

REVISION 2.2 , 2002/04/26

FTP server WEB server Streaming server

translation done by MikHo (micke@jagegud.com)