LiquidFiles Documentation
LiquidFiles Documentation

Share Files Upload Actionscripts

The Share Files Actionscript works similar to the Attachment Upload Actionscripts.

The main difference when executing is that there's different available environment variables. The script will be executed as the equivalient of:

env SHARE=<the_share_name> SHARE_ID=<the_share_id> FILENAME=<the_file_name> your_actionscript.ext /path/to/uploaded/file

When uploading share files, the uploaded file is not stored with the "real" file name. You cannot perform file name checks using the "/path/to/uploaded/file" name. For file name checks, please use the FILENAME environment variable.

An example script would be the same as the Attachment Upload Actionscript:

#!/usr/bin/env ruby

# assign the user and group to variables (not strictly needed for this example)
share_name=ENV['SHARE']
share_id=ENV['SHARE_ID']
filename=ENV['FILENAME']

if filename =~ /\.png$/i
  puts "PNG's are not allowed"
  exit 1
end