!Upload with approval and move files.\\

This job requires a CrushFTP Enterprise license to work.\\
----
You can set up an event to trigger a job that will email the assigned approver to allow or reject the uploaded files and write an automatic entry into an audit log.\\

The limited user will have a folder that has upload only and another folder that has download only permissions.
The approver user assigned to accept or reject the files will also need view permission for the upload folder.\\

[attachments|limitedup.png]\\

[attachments|limiteddown.png]\\

[attachments|user_event1.png]\\

[attachments|user_event2.png]\\

[attachments|assigned_admin_priv.png]\\

The assigned approver user will need to add a custom button under UserManager, UserName (default for all users), in the QuickJump select Webinterface, scroll down a little and at the Buttons section click on 'Add'\\

[attachments|approve_button_js.png]\\

{{{
javascript:customEvent({paths:"{files}"});
}}}

Next, we add an event on the approver, its type must be 'Custom' and to do it immediately, and do it async.

[attachments|admin_event.png]\\

We first assign a variable to hold the home folder name of this user, and we grab it out of the URL.  So in our example, position 6 of the url is the folder who's name matches the username.  {6url} gives that to us,a nd we assign it to a variable for use.

[attachments|task_flow.png]\\

[attachments|user_variable.png]\\

The jump conditional will check to make sure the approver is not approving their own file, and if they are, deny it and log an audit log entry.
Set the jump conditional to validate: {upper_start}{username}{upper_end} Doesn't Equal {upper_start}{home_folder_of_file}{upper_end}

[attachments|jump_conditional.png]\\

[attachments|url.png]\\

We move the item passed in from the approval to go up one level from the upload folder, then into the download folder to move the file there.

[attachments|move.png]\\

We use a WriteFile task to write a log entry to an audit log file on our drive.

[attachments|audit_log.png]\\

And if they fail, we write a failure message.

[attachments|denied.png]\\