files are put in the server directors in this order
/root/cgi-bin
/root/htdocs .......there was no htdocs folder in the root so i created this
My COnfig
Code: Select all
package XUploadConfig;
use strict;
use Exporter ();
@XUploadConfig::ISA = qw(Exporter);
@XUploadConfig::EXPORT = qw($c);
use vars qw( $c );
$c=
{
# Directory for temporary using files (local path from root, not URL)
temp_dir => '/home/content/c/r/a/crabbygg/html/cgi-bin/temp',
modes =>
{
1 =>
{
# Directory for uploaded files (local path from root)
target_dir => '/home/content/c/r/a/crabbygg/html/cgi-bin/uploads',
# URL to send all input values from upload page
url_post => 'http://www.thetechlife.org/cgi-bin/post.php',
# Max number of upload fields
max_upload_files => 4,
# Minimum total upload size in Kbytes (leave empty or zero to disable)
min_upload_size => 7,
# Maximum total upload size in Kbytes
max_upload_size => 10000,
# Allowed file extensions delimited with '|'
# Use '.*' to allow all extensions
ext_allowed => 'jpg|jpeg|gif|png|rar|zip|txt',
},
2 =>
{
# Directory for uploaded files
target_dir => '/home/content/c/r/a/crabbygg/html/cgi-bin/uploads',
# URL to send all input values from upload page
url_post => 'http://www.thetechlife.org/cgi-bin/post.cgi',
# Minimum total upload size in Kbytes
min_upload_size => 5,
# Max number of upload fields
max_upload_files => 2,
# Maximum total upload size in Kbytes
max_upload_size => 10000,
# Allowed file extensions delimited with '|'
# Use '.*' to allow all extensions
ext_allowed => 'jpg|jpeg|gif|png|rar|zip|txt',
},
},
# Max length of uploaded filenames(without ext). Longer filenames will be cuted.
max_name_length => 64,
# Type of behavior when uploaded file already exist on disc. Available 3 modes: Rewrite/Rename/Warn
copy_mode => 'Rename',
# Filename required mask (use standard perl regexp)
# Extension is not using here (e.g. will use 'song123' for 'song123.mp3')
# Leave empty if you don't need this custom filename validation
# Examples: '^\w+$' - alphanumeric only, '^photo' - starting with 'photo'
filaname_mask => '',
# Filename rename mask (use standard perl regexp)
# Removing all characters except these from the mask
# Extension is not using here (e.g. will use 'song123' for 'song123.mp3')
# Leave empty if you don't need this custom filename renaming
# Examples: 'a-zA-Z' - will keep letters only, '\w' - will keep alphanumeric only
filename_rename_mask => '',
# Allow relative folder path for uploading files from HTML form ext_folder field
# Pathes with '..' are not allowed
# 0=no,1=yes. [Security Warning!]
allow_ext_folder => 0,
# Password for upload (optional)
# Allow uploads only with correct password. Add '<input type="password" name="upload_password">' to your upload_form.html to use this feature.
# Leave empty to disable
upload_password => 'kingkong',
# Email field required (optional)
# Force users to enter their email address. Upload notification to that email will be sent.
# Leave empty to disable, set to 1 to enable
email_required => '',
# Logfile name
uploads_log => 'log.txt',
# Enable users to add descriptions to files
enable_file_descr => 1,
# Uploaded files expiration time # days
# Leave blank or zero to disable
uploaded_files_lifetime => 0,
# Time to keep temp upload files on server, sec (24 hours = 86400 seconds)
temp_files_lifetime => 86400,
# IP restrictions
# Examples: '^(10\.0\.0\.182)$' - allow only 10.0.0.182,
# '^(10\.0\.1\.125|10\.0\.0\.\d+)$' - allow
# 10.0.1.125 & 10.0.0.* (*=number is wildcard)
# OR leave blank to allow all
ip_allowed => '',
##### Email confirmation #####
# Leave all fields blank OR comment them if you don't want to send confirmations
# Path to sendmail
sendmail_path => '/usr/sbin/sendmail',
# Email that confirmations will be sent to
confirm_email => '[email protected]',
# This email will be in "From:" field in confirmation emails
confirm_email_from => '[email protected]',
# Subject for email notification
email_subject => "Xupload: new file uploaded",
##### Custom error messages #####
msg => { filesize_exceeded => "Maximum upload size exceeded<br>Please stop transfer right now.<br>Max filesize is: ",
filesize_min_exceeded => "Minimum upload size limit detected.<br>Please stop transfer right now.<br>Min filesize is:",
no_temp_dir => "No temp dir exist! Please fix your temp_dir variable in config.",
no_target_dir => "No target dir exist! Please fix your target_dir variable in config.",
no_templates_dir => "No Templates dir exist! Please fix your templates_dir variable in config.",
transfer_complete => "Transfer complete!",
transfer_failed => "Upload failed!",
null_filesize => "have null filesize or wrong file path",
bad_filename => "is not acceptable!",
bad_extension => "have unallowed extension!",
too_many_files => "wasn't saved! Number of files limit exceeded.",
already_exist => "already exist!<br>Renaming to ",
saved_ok => "was saved successfully.",
wrong_password => "You've entered wrong password.<br>Authorization required.",
ip_not_allowed => "You are not allowed to upload files",
},
##########
# CSS names
styles => { 'black' => 'black.css',
'hitech' => 'hi_tech.css',
'aqua' => 'aqua.css',
'hitech' => 'hitech.css',
'contrast'=> 'contrast.css',
'pro1' => 'pro1.css',
},
# Template names
templates => { 'simple' => 'simple.html',
'hitech' => 'hitech.html',
'nice' => 'nice.html',
'pro1' => 'pro1.html',
'pro2' => 'pro2.html',
},
};
1;
Html forum
Code: Select all
<HTML>
<HEAD>
<Title>XUpload form</Title>
<Style>
FIELDSET {width: 400px;background-color: #f9f9f9; border: 1px solid #b3b3b3; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-align: left; padding: 10px; padding-top: 0px;}
LEGEND {background-color: #f0f0f0; border: 1px solid #b3b3b3; font: bold 13px Arial; padding: 2px;}
.div1, .file_list {text-align: left; color: #484B50;}
.div1 {width: 100%; padding: 10px;}
.upload_input input {font: 12px Arial; border: 1px solid #636363; margin-top: 1px; width: 100%;}
.file_list {width: 100%; border: 1px solid #434343; background-color: #ffffff;}
.file_list input, .myForm {font: 12px Arial; border: 1px solid #636363; margin-top: 1px;}
</Style>
</HEAD>
<BODY>
<Center>
<br><br>
<form name="F1Upload" enctype="multipart/form-data" action="/cgi-bin/upload.cgi?upload_id=" method="post" onSubmit="return StartUpload(this);">
<input type="hidden" name="xmode" value="1">
<FIELDSET>
<LEGEND>XUpload PRO Demo 2</LEGEND>
<div id="slots" class='upload_input'>
<br><input name="file_0" type="file" onChange="checkExt(this)" size=40><br>
</div>
<input type="button" id="x_add_slot" value="+1 upload slot" class="myForm" onClick="addUploadSlot();"><br><br>
<script>document.write('<script src="' + document.F1Upload.action+'&mode=settings' + '" type="text/javascript"><\/script>');</script>
<Input type="checkbox" name="popup" id="popup"><label FOR="popup" ACCESSKEY="Z">Show upload status in pop-up</label><br>
<Input type="checkbox" name="inline" id="inline"><label FOR="inline" ACCESSKEY="X">Show upload status on this page</label><br>
<br>
<center><input type="submit" value="Upload Files" class="myForm"></center>
<br>
</td></tr></table>
</FIELDSET>
<input type="hidden" name="css_name" value="">
<input type="hidden" name="tmpl_name" value="pro1">
</form>
</Center>
<iframe src="about:blank" name="upload" frameborder=0 style="width: 0px; height: 0px;"></iframe>
<script>document.write('<script src="' + document.F1Upload.action+'&mode=settings' + '" type="text/javascript"><\/script>');</script>
<script src="xupload.js"></script>
</BODY>
</HTML>