XUpload - Lost

Message
Author
iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

Lost

#1 Postby iamheaddown » Oct 17, 2006 3:43 pm

Please help me!

I have read through the installation instructions and completed everything as noted and required. When I go to my upload page:

http://www.midwestcomposite.com/upload/ ... form2.html

nothing is working or happening. When I view the page source, I see the xupload.js file is not being included for whatever reason. This might be part or all of the problem. I have tried moving the script tags in the header, I have tried using a relative and absolute address for the xupload source tag and it will not include. Here are the details to what I have done so far and files etc:

I installed the following files and folders in /web/midwestcomposite.com/cgi-bin/upload/

HTML (Folder and contents)
STYLES (Folder and contents)
temp (Folder & CHMOD to 755)
Templates (Folder and contents)
uploads (Folder & CHMOD to 755)
changelog
post.cgi
post.php
upload.cgi
upload_status.cgi
XUploadConfig.pm

This is my XuploadConfig.pm file

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
 temp_dir        => '/web/midwestcomposite.com/cgi-bin/upload/temp',

 # Directory for uploaded files
 target_dir      => '/web/midwestcomposite.com/cgi-bin/upload/uploads',

 # Allowed file extensions delimited with '|'
 # Use '.*' to allow all extensions
 ext_allowed     => 'jpg|jpeg|gif|png|rar|zip|mp3|avi|txt|csv|wma|stl',

 # Filename required mask (use standard perl regexp)
 # Extension is not using here (e.g. will use 'song_123' for 'song123.mp3')
 # Leave empty if you don't need this custom filename validation
 filaname_mask   => '',

 # Filename rename mask (use standard perl regexp)
 # Remove all characters except these from the mask
 # Extension is not using here (e.g. will use 'song_123' for 'song123.mp3')
 # Leave empty if you don't need this custom filename renaming
 # Example: 'a-zA-Z \.\-_\+!\(\)'
 filename_rename_mask   => '',

 # Allow relative folder path for uploading files from HTML form ext_folder field
 # Paths with '..' are not allowed
 # 0=no,1=yes. [Security Warning!]
 allow_ext_folder => 0,

 # URL to send all input values from upload page
 url_post        => '/web/midwestcomposite.com/cgi-bin/upload/post.cgi',

 # The link to redirect after complete upload
 redirect_link   => '/web/midwestcomposite.com/htdocs/upload/upload_form.html',

 # Max length of uploaded filenames(without ext). Longer filenames will be cuted.
 max_name_length => 64,

 # Max number of upload fields
 max_upload_files => 4,

 # Type of behavior when uploaded file already exist on disc. Available 3 modes: Rewrite/Rename/Warn
 copy_mode       => 'Rename',

 # Maximum total upload size in Kbytes
 max_upload_size => 140000000,      

 # Time to keep temp upload files on server, sec (24 hours = 86400 seconds)
 temp_files_lifetime => 86400,

 # 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 password checking
 upload_password => '',

 # Logfile name
 uploads_log => 'log.txt',

 # Enable users to add descriptions to files
 enable_file_descr => 1,

##### 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 => 'Midwest Composite - Engineering Dept',

 # Subject for email notification
 email_subject      => "Successful File Upload",

##### Custom error messages #####

 msg => { filesize_exceeded => "Maximum upload size exceeded<br>You should stop transfer right now.", # showing in progress pop-up while uploading
          filesize_exceeded2=> "Maximum upload size exceeded.",                                       # showing in upload_form after upload
          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. Authorization required.",
        },

##########

 # CSS names
 styles			 => { 'hitech'  => 'hitech.css',
                              'contrast'=> 'contrast.css',
                              'pro1'    => 'pro1.css',
			    },

 # Template names
 templates => { 'simple' => 'simple.html',
                'hitech' => 'hitech.html',
                'pro1'   => 'pro1.html',
                'pro2'   => 'pro2.html',
	      },
};

1;
I also copied the following files to /web/midwestcomposite.com/htdocs/upload/
bgx1.gif
bgx2.gif
trans_bg.gif
upload_form.html
upload_form2.html
xupload.js

This is my upload_form2.html file after I modified address of CGI scripts:

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/upload.cgi?upload_id=" method="post" onSubmit="return StartUpload(this);">

<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>


Upload to folder: <input type="text" name="ext_folder" size=32 class="myForm"><br><br>
Your E-mail: <input type="text" name="email_notification" size=24 class="myForm"><br>
<small>We will send e-mail notification to your address.</small><br><br>

<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>
Please help me, I am lost and have no idea what I am doing wrong, thanks. :D

-iamheaddown

iamheaddown
Posts: 6
Joined: Oct 17, 2006 3:22 pm

RESOLVED

#2 Postby iamheaddown » Oct 18, 2006 5:00 am

Didn't realize that all *.cgi files in the cgi-bin folder needed permissions set to 755. I set them to 755 and it works.

Someone should really mention that in the installation instructions, thanks.

-iamheaddown