Search K
Appearance
Appearance
This hook script is to be called before DA runs anything from CMD_FILE_MANAGER or CMD_API_FILE_MANAGER.
Saves needing to use all_pre.sh for File Manager-related blocks.
All GET/POST variables are passed via the environment.
Custom hook script which is run for each fully uploaded file in File Manager.
The hook acts on the temporary file right before it is moved to the target destination.
If hook exits with non-zero status, file upload is cancelled and temporary file is removed by DirectAdmin (destination is left untouched).
Note: The hook must be accessible to the user as it is executed as the user. Recommended permissions for the hook are 0755.
/usr/local/directadmin/scripts/custom/file_manager_upload_pre.sh
#!/bin/sh
clamdscan --no-summary --fdpass "$file"Note: on systems where clamav daemon is running TCP-only, use --stream instead of --fdpass.
# Ensure it is accessible by the user
chmod 0755 /usr/local/directadmin/scripts/custom/file_manager_upload_pre.shAdded in DirectAdmin 1.694
Custom hook script which is run before user file removal action in File Manager.
If hook exits with non-zero status, removal is cancelled and file is kept untouched.
Note: The hook does not cover all possible ways of file removal. Only remove action initiated by the user itself in File Manager is covered.