XUpload - HTTP Error 403 Forbidden

Message
Author
jwilcoxiii
Posts: 6
Joined: Nov 06, 2006 11:13 pm

HTTP Error 403 Forbidden

#1 Postby jwilcoxiii » Nov 06, 2006 11:18 pm

Hello All,

I have a Windows XP system running Apache 2.2.3 with PHP 5.2.0. I am unable to get the upload status window to show. I get a HTTP Error 403 Forbidden. Saying that I need to login to the page. I have been unable to find anywhere to turn this off and would like to know if anyone knows how to disable this. I am using Xupload 2.5 demo. I would like to get it to work properly before I purchase the pro version. Please Help. I have Enabled the IUSR_computer to full access on that folder. If there is anything else I need to do please let me know.

Thanks,
James

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Nov 07, 2006 6:22 am

Do you have Perl installed? Did you put .cgi files to cgi-bin folder?

jwilcoxiii
Posts: 6
Joined: Nov 06, 2006 11:13 pm

#3 Postby jwilcoxiii » Nov 07, 2006 4:09 pm

Yes I have perl installed on my pc did that last night after posting and checking other posts. I do not have the files in a cgi-bin folder. Does the CGI-BIN folder have to be within the root of the website or can it be outsite the htdocs folder? I will move them and check.

jwilcoxiii
Posts: 6
Joined: Nov 06, 2006 11:13 pm

#4 Postby jwilcoxiii » Nov 07, 2006 4:20 pm

I tried to copy the cgi-bin folder into the root and copied all files except for upload_form.html which is under xupload folder. I still get the http 403 error. I don't know where I need to set permissions. Is there somewhere to turn off authentication.

jwilcoxiii
Posts: 6
Joined: Nov 06, 2006 11:13 pm

#5 Postby jwilcoxiii » Nov 07, 2006 4:28 pm

here is my upload_form.html
<HTML>
<HEAD>
<Title>XUpload - upload progress bar</Title>

<Style>
body {align: center; width: 400px;background-color: #f9f9f9; border: 1px solid #b3b3b3; font: 13px Arial; text-align: left;}
LEGEND {background-color: #f0f0f0; border: 1px solid #b3b3b3; font: bold 13px Arial; padding: 2px;}
.div1, .file_list {text-align: left; color: #484B50; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;}
.div1 {width: 100%; padding: 10px;}
.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>

<Script language="JavaScript">

var exts = ".*";
//var exts = ".*"; //Use this to accept all Extensions

//- Fix for Netscape 6/Mozilla ------------
if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement)
{
HTMLElement.prototype.insertAdjacentElement = function
(where,parsedNode)
{
switch (where){
case 'beforeBegin':
this.parentNode.insertBefore(parsedNode,this)
break;
case 'afterBegin':
this.insertBefore(parsedNode,this.firstChild);
break;
case 'beforeEnd':
this.appendChild(parsedNode);
break;
case 'afterEnd':
if (this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else this.parentNode.appendChild(parsedNode);
break;
}
}

HTMLElement.prototype.insertAdjacentHTML = function
(where,htmlStr)
{
var r = this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML = r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML)
}
}
//---------------------


var UID,NF=0,cx=0;
function openStatusWindow()
{
if(document.F1.popup.checked == true)
{
win1 = window.open('http://65.31.45.183/xuploads/upload_sta ... esizable=1');
win1.window.focus();
}
}

function generateSID()
{
UID = Math.round(10000*Math.random())+'0'+Math.round(10000*Math.random());
var f1=document.F1;
f1.action = f1.action.split('?')[0]+'?upload_id='+UID;
//for (var i=0;i<document.F1.length;i++)
//{
// current = document.F1.elements;
// if(current.type=='file' && current.value!='')NF++;
//}
}

function StartUpload()
{
NF=0;
for (var i=0;i<document.F1.length;i++)
{
current = document.F1.elements;
if(current.type=='file' && current.value!='')
{
if(!checkExt(current.value))return false;
NF++;
}
}
generateSID();
openStatusWindow();
}

function checkExt(value)
{
if(value=="")return true;
var re = new RegExp("^.+\.("+exts+")$","i");
if(!re.test(value))
{
alert("Extension not allowed for file: \"" + value + "\"\nOnly these extensions are allowed: "+exts.replace(/\|/g,',')+" \n\n");
return false;
}
return true;
}

</Script>
</HEAD>
<BODY>
<center>
<h2>XUpload demo page</h2>
<form action="http://65.31.45.183/cgi-bin/upload.cgi?upload_id=" method="post" enctype="multipart/form-data" name="F1" target="upload" onSubmit="return StartUpload();">
<div id="slots"></div>
Send file: <input name="file1x" type="file" onChange="checkExt(this.value)"><br>
<br>
Comment:<br>
<textarea name="commentxy" cols="30" rows="5" wrap="virtual" valign="top">
This is a test field to show sending POST request to external script.
You can use any number or all form elements.
</textarea>
<br><br>
<Input type="checkbox" name="popup" checked id="popup"><label FOR="popup" ACCESSKEY="Z">Show upload status in pop-up window</label><br>
<br>
<input type="submit" value="Upload Files">
<input type="hidden" name="css_name" value="">
<input type="hidden" name="tmpl_name" value="">
<br><br>
</form>
<br><br>

<iframe src="about:blank" name="upload" frameborder=0 style="width: 0px; height: 0px;"></iframe>
<div id="div_inline" style="position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; background: http://3.181.52.15/xuploads/trans_bg.gif; text-align: center; padding-top: 50px; display: none;">
<iframe src="about:blank" name="transfer" border=0 xSCROLLING=NO topmargin=0 leftmargin=0 frameborder=0 style="width: 320px; height: 240px; border: 1px solid #a3a3a3;"></iframe>
</div>
<a href="http://www.sibsoft.net/xupload.html">SibSoft XUpload - upload progress bar</a>
</center>
</BODY>
</HTML>

here is my xuploadconfig.pm
package XUploadConfig;

BEGIN
{
use Exporter;
@XUploadConfig::ISA = qw( Exporter );
@XUploadConfig::EXPORT = qw( $c );
}

our $c=
{
# Directory for temporary using files
temp_dir => 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\cgi-bin\temp',

# Directory for uploaded files
target_dir => 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\cgi-bin\uploads',

# Path to the template using for upload status window
templates_dir => 'C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\cgi-bin\Templates',

# Allowed file extensions delimited with '|'
ext_allowed => '.*',

# The link to redirect after complete upload
# This setting can be submitted from HTML form, then it will have priority
redirect_link => 'http://65.31.45.183/xuploads/upload_form.html',

# 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',

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

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

# CSS names
styles => { 'black' => 'black.css',
'hitech' => 'hi_tech.css',
'aqua' => 'aqua.css',
'tiny' => 'tiny.css',
'contrast'=> 'contrast.css',
},

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

1;


Tell me if you need anything else.

Here is my website I am building
http://65.31.45.183/xuploads/upload_form.html

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#6 Postby PilgrimX182 » Nov 08, 2006 12:31 pm

You have to set up Apache to run cgi scripts inside cgi-bin folder.
This URL should work when you fix Apache config: http://65.31.45.183/cgi-bin/upload.cgi?mode=settings

Please read Apache config manuals and configure it.

Another problem: you have wrong IP inside upload_form.html, it should be the same as you use in upload_form.html URl (65.31.45.183)

jwilcoxiii
Posts: 6
Joined: Nov 06, 2006 11:13 pm

#7 Postby jwilcoxiii » Nov 08, 2006 6:10 pm

thanks for all your help.. I have found some problems within my httpd.conf file. I have changed them and now it seems to be working properly.