submitting without opening a new window

XUpload related questions

Moderator: admin

Message
Author
drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

submitting without opening a new window

#1 Postby drumcritic » Jul 28, 2007 1:03 pm

is there a way to load upload.cgi without opening a new window?
I have the free version

thx

User avatar
PilgrimX182
Posts: 2181
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#2 Postby PilgrimX182 » Jul 30, 2007 6:42 am

Not sure what you mean. Progress bar window is optional (checkbox). upload.cgi opens in hidden iframe. What new window?

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#3 Postby drumcritic » Jul 30, 2007 7:51 pm

really? upload.cgi doesn't open in a different iframe for me.

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#4 Postby drumcritic » Aug 22, 2007 6:34 pm

where is the code that opens upload.cgi in a hidden iframe? i can't seem to find it in the program.

User avatar
PilgrimX182
Posts: 2181
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#5 Postby PilgrimX182 » Aug 23, 2007 6:05 am

In xupload.js:

Code: Select all

 f1.target='xupload';


this can be skipped if you have some JS error on page. Please check for this.

drumcritic
Posts: 15
Joined: Apr 06, 2007 3:14 am

#6 Postby drumcritic » Aug 23, 2007 10:54 pm

weird... i cant find f1.target in xupload.js.
I have the free version
here is xupload.js:

<Script language="JavaScript">
var totalsize=<TMPL_VAR data_total>;
function setCookie( sName, sValue )
{
if(sName.length<1)return;

if (0<sValue.length)
{
var expDate = new Date();
expDate.setTime( expDate.getTime() + 365*24*60*60*1000 );

document.cookie = "" + sName + "=" + sValue + "; " + "expires=" + expDate.toGMTString();
}
else
{
// this will cause the named cookie to be deleted.
document.cookie = sName + "=";
}
}

function fetchDocumentCookie( sName )
{
var sValue = "";
var index = 0;

if( document.cookie )
index = document.cookie.indexOf( sName + "=" );
else
index = -1;

if ( index < 0 )
{
sValue = "";
}
else
{
var countbegin = (document.cookie.indexOf( "=", index ) + 1);
if ( 0 < countbegin )
{
var countend = document.cookie.indexOf( ";", countbegin );
if ( countend < 0 )
countend = document.cookie.length;
sValue = document.cookie.substring( countbegin, countend );
}
else
{
sValue = "";
}
}
return sValue;
}

function changeValue(id,value)
{
if(id && document.getElementById(id))
{
document.getElementById(id).innerHTML = value;
}
}

function SP(cursize,time,speed,files,left)
{
var percent = parseInt(100*parseFloat(cursize)/parseFloat(totalsize));
document.getElementById('upload_status').style.width = percent+'%';
changeValue('percent', percent+'%' );
changeValue('current',cursize);
changeValue('speed',speed);
changeValue('time', convertSeconds(time) );
changeValue('left', convertSeconds(left) );
}

function convertSeconds(seconds)
{
hours = parseInt(seconds/36000);
mins = parseInt(seconds/60);
secs = seconds - hours*3600 - mins*60;
if(hours<10){ hours = '0'+hours; }
if(mins<10){ mins = '0'+mins; }
if(secs<10){ secs = '0'+secs; }
return hours+':'+mins+':'+secs;
}

function Message(msg)
{
document.getElementById('message').innerHTML += msg+'<br>';
window.scrollBy(0,550);
}

function SetUpSettings()
{
if(!document.getElementById('close_finished'))return;
cf = fetchDocumentCookie( 'close_finished' );
if(cf=='false')cf=0;
document.getElementById('close_finished').checked = cf;
}

function ClosePopUp()
{
if(document.getElementById('close_finished') && document.getElementById('close_finished').checked==true)self.close();
}
</Script>

User avatar
PilgrimX182
Posts: 2181
Joined: Mar 22, 2006 1:39 pm
Location: UFO Lab
Contact:

#7 Postby PilgrimX182 » Aug 24, 2007 5:51 am

Ah, sorry forgot that u have free version. In free targer specified in upload_form.html:

Code: Select all

 target="upload"

and there is upload iframe:

Code: Select all

<iframe src="about:blank" name="upload" frameborder=0 style="width: 0px; height: 0px;"></iframe>


maybe you have name collisions, try to rename upload to e.g. xupload.


Return to “XUpload”

Who is online

Users browsing this forum: No registered users and 0 guests