Easy Pass to Secure File Transfer
TM
»User: »Password:   Remember Me? 
Sysax Product Forums / Sysax FTP Automation / General Discussion / Generating custom scripts
Posted:  18 Aug 2010 23:23   Last Edited By: Ash575
If I wanted this program to run a script after when someone uploads; can the script contain variables/wildcards based on information that happens on the FTP server?  Is there a list that contains the variables/wildcards that can be used?

Example:

Someone logs in to the FTP server with an account called JohnDoe.  JohnDoe uploads a file called testfile.txt

Each user that logs into the server will have their own specific folder to send files to.  So JohnDoe's folder will be called "johndoe".

When the file is done uploading I want the script to run an event that copies it from the folder for that (or for any) specific user and move it to another server with the similar file structre (i.e. going to a specific folder based on username). 

When the file has been moved an email will be generated informing us of the file upload.  The email will contain the user who uploaded and the name of the file that was uploaded.  Basically saying User: johndoe successfully uploaded file: testfile.txt   The name and file name would change to match who was logged in at that time and the name of the file that was sent.

Just curious to know if there are variables like $_User (or something like that) to use in the script to pass information to the script that runs.

Thanks.
Posted:  09 Feb 2011 21:35
I am assuming that you are referring to scripts that trigger based on user events (for the Sysax Multi Server product). Yes, each time a script is invoked, the following variables are passed to it. This is also documented in the sample script that ships with the product.

#       The following variables are preloaded before the script
#       starts executing. These variables provide information about the type of trigger
#       that caused the script to execute and some information about the triggered event:
#
#       ~SERVER_TRIGGER      - This variable provides information on the type of trigger that
#                              caused the script to execute. Possible values are:
#                              "loginok"    - A user successfully logged into an account
#                              "loginerror" - A user tried to login but was rejected
#                              "download"   - A user successfully downloaded a file
#                              "upload"     - A user successfully uploaded a file
#                              "rename"     - A user successfully renamed a file
#                              "delete"     - A user successfully deleted a file
#
#       ~SERVER_ACCOUNT      - This variable contains the user account name that generated the
#                              event
#
#       ~SERVER_IPADDRESS    - This variable contains the IP address name of the connection that
#                              generated the event
#
#       ~SERVER_FILENAME     - This variable contains the filename if this is a download, upload,
#                              rename, or delete event. For a rename or delete event, this variable
#                              contains the former name of the file that was deleted or renamed
#
#       ~SERVER_ABSFILENAME  - This variable contains the absolute filename if this is a download,
#                              upload, rename, or delete event. For a rename or delete event, this
#                              variable contains the former absolute name of the file that was
#                              deleted or renamed
#



-------------------------------
FTP Server solutions simplified
 

Copyright © 2008 Codeorigin, LLC - All Rights Reserved.
XML RSS 2.0 XML Atom 1.0