#!/usr/bin/perl
# This is a basic script to interface with our
# RJUPLD File Upload Pro client program.
# You must leave the copyright information in this script.
# The setup below is fairly simple. There is no read-me, all
# help is below in the form of comments for each variable.
# You will want to modify the sub routine -> Process_Upload
# below for your specific purpose. This program is fully
# functional and will write the uploaded files to a directory
# specified in the $Save_Folder variable below.
# To write to sub-directories of $Save_Folder, you can use
# the returned variables. Also you can use the returned
# variables for user authentication, or anything else
# you may need.
# This program can handle any type of file, from images and
# HTML pages to executables. Configure the $RJ_UPLD_Allowed_File_Types
# variable below to specify the types of files that are allowed.
# There are 5 fields that are returned from the client upload.
# 1. The uploaded file + File Name
# 2. Auth_Key (this is a key that you specify to be returned, see below.)
# 3. Field1 (this is a spare field you can use for anything)
# 4. Field2 (this is a spare field you can use for anything)
# 5. Sub_Folder (sub directoty to upload to)
# Name the spare fields anything you need below.
# The Auth_Key is returned with each upload for security.
# In the free version only images can be uploaded and the file
# size of the image must be less than 50K - gif, jpg, jpeg, png
# Sub-Folders are not supported in free version
# We also have a version that can automatically resize the images
# when they reach the server. There are 3 options for sizes.
# Origional image no matter what size, a medium size image and
# a small image.
# If you are using image resize, the program needs to append
# the file name.
# Example: for the Small size image you can use
# $RJ_UPLD_Small = '90-s'; The '-s' will be apended to the
# origional file name. Origional_name-s.jpg
# YOU MUST USE THE DASH! NO OTHER CHARACTORS WILL WORK.
# There are 2 options for how the client program is
# accessed. Both use javascript.
# If you want to use the option that prints the client program
# using a full page (as in option 2 below) we can customize
# that page for you with your logo and instructions for the
# client. This requires that you buy an unlimited client license
# that you will distribute to your customers.
# If our standard build is used, we require your customer to
# download the client program from our site.
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#
#
# Program is copyright by Ranson's Scripts all rights reserved
# Email - support@rlaj.com
#
# Program Name ------- RJUPLD Upload Pro
# Script Name -------- upload.pl
# Program Version ---- 1.01
# Configuration File - None, see below.
#
# If FTP'ing this file, be sure to send in ASCII format
#
#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#
#############################################################################################
####################################### BEGIN SETUP #######################################
#############################################################################################
# for option 1
# Use the following script to start the upload process.
# Place this script on your page where you want the
# user to start the upload process.
#
# This is the preferred process. You decide how to access
# this script that works best for you.
#
#
# link: Upload Program
# Folder all uploaded files will be written to
# Must be complete path
# For UNIX: must be set to 777
# DO NOT USE TRAILING SLASH
$Save_Folder = '/usr/var/www/docs/bulkfileupload/uploads';
# For perl files, do you want the chmod them to 755
# May not work on all systems
# Not necessary for Windows servers.
# 1 = yes 0 = no
$Chmod_Perl = '0';
# To set other files to 666 rw-rw-rw or ???
# 1 = yes 0 = no
$Chmod_Others = '1';
# Setup an encryption key below for authentication
# this can be any length and make it cryptic.
# DO NOT USE DOLLAR SIGN, QUESTION MARK OR QUOTES,
# OR A PIPE (|) Character.
# Use numbers and mostly lower case letters.
# Allowed Special Characters: ^ * ! [ ] ~ @ # % :
$Auth_Key = 'rAy^*!4622retVvd[]~';
# There are 2 options for how the client program is
# accessed. Both use javascript.
# 1. Use the script above to access the upload.pl
# This opens a window that resizes itself to
# 320 X 600 the client program is placed in
# this window.
# 2. Accesses this script directly with browser.
# This opens a file on the users machine
# with an Iframe on the left that houses
# the client program.
$script_access = '2';
### *** :) *** ###
# Default folder to start in on users machine
# Must be CAPITAL LETTER -> C:/ or D:/ etc.
# Can alos be path -> C:/My+Documents/My+Pictures
# Replace any spaces with +
$RJ_UPLD_Default_Folder = 'C:/';
# Set the Allowed File Types Below
# I = all image types.
# H = HTML files only
# IH = all images + HTML
# A = all file types
# A-E = all files except execuatables - exe, bat, etc.
# A-E-S = no executables and no system files.
# SP = specify file types. Use colon : between types
# FORMAT -> SP<>gif:jpg:jpeg
# In the free version, only images may be uploaded,
# gif, jpg, jpeg, png
$RJ_UPLD_Allowed_File_Types = 'IH';
# List all text files below
$TextFiles = '.txt^.htm^.html';
# Upload Type - C = Multi-File-Uploads
# R = Single-File-Upload
$RJ_UPLD_Upload_Type = 'C';
# Set the Maxium size of the file that can be
# Uploaded. for 50K - enter 50000
# Disabled in the free version and set to 50k
$RJ_UPLD_Max_Size = '150000';
# If you want your user to be able to upload
# files to their sub-directories, set the variable
# to '1' below. 0 = no
# This will find sub dirs to 3 levels deep
# /userfolder/sub1/sub2/sub3
# All uploadable Folders must be set to chmod 777
# Not available in free version
$RJ_UPLD_Allow_SUB_Dir = '1';
# If you only want your users to be able to upload
# to certain sub-folders, enter them below
# Use ^ between folders
# Leave blank to auto-detect user sub-folders
# Or comment out to auto-detect user sub-folders
#$RJ_UPLD_SPECIFY_SUB_Dirs = 'images^html';
# Program to handle the upload on your server (this file?)
$RJ_UPLD_Return = 'http://www.bulkfileupload.com/cgi-bin/rjupld-upload.pl';
# Enter web address for the style sheet
$StyleSheet = 'http://www.bulkfileupload.com/style.css';
# Return Field1 Value
$RJ_UPLD_Field1_Value = '';
# Return Field1 Name
$RJ_UPLD_Field1_Name = 'day';
# Return Field2 Value
$RJ_UPLD_Field2_Value = '';
# Return Field2 Name
$RJ_UPLD_Field2_Name = 'caption';
### *** :) *** ###
# USING IMAGE RESIZE OPTION
# Not available in free version
# List all images allowed to be uploaded
# Must use the dot
# Put a colon (:) between file types
$AllowedImages = ".gif:.jpg:.jpeg:.png";
# Specify Size of Small Returned Image
# and the filename addition
# Size is width^height
# 90^90^s
# 90 x 90 px - add -s to the filename
# Leave blank or comment out for no resize
$RJ_UPLD_Small = '90^90^-t';
# Specify Size of Meduim Returned Image
# and the filename addition
# Size is width^height
# 200^200^m
# 200 x 200 px - add -m to the filename
# Leave blank or comment out for no resize
$RJ_UPLD_Medium = '400^400^-m';
# If you want the origional size image uploaded
# set the variable below to '1' 0 = no
# Only applies of you are using resize above.
$RJ_UPLD_Orig = '1';
#############################################################################################
######################################## END SETUP ########################################
#############################################################################################
print "Content-type: text/html\n\n";
if ($ENV{'REQUEST_METHOD'} =~ /GET/i){ &Ready_Client(); }
else { &Process_Upload(); }
exit;
### *** :) *** ###
# Do not change the javascript below.
# Do not change the $RJ_UPLD_QS.
sub Ready_Client {
if ($RJ_UPLD_Allow_SUB_Dir eq "1" && $RJ_UPLD_SPECIFY_SUB_Dirs eq "") { &Find_Subs(); }
if ($RJ_UPLD_Allow_SUB_Dir eq "1" && $RJ_UPLD_SPECIFY_SUB_Dirs ne "") { $folders = $RJ_UPLD_SPECIFY_SUB_Dirs; }
&Build_QS();
if ($script_access eq "1") {
$JS_Setup = qq! function Isonline() {
setup = 1;
var MyHeight = (window.screen.height) - 20;
//window.resizeTo(625,MyHeight);
document.write('
|
The client program, RJUPLD, is not running. Please start the program on your computer. To start the program, Click Start -> Programs -> Startup -> RJUPLD if you have not downloaded the client upload program, RJ_UPLD_Install.exe please download and install it now. http://www.rlaj.com/RJ_UPLD/RJ_UPLD_Install.exe if you browser blocks popups, click here to start upload. Note: if you see a window that says 'connection refused' then your client is not running and you need to start the RJUPLD on your computer. |