XUpload - Using the 'x_max_files' and 'x_max_size' more times on page

Message
Author
Guest
Posts: 18
Joined: Jan 30, 2007 10:41 pm

Using the 'x_max_files' and 'x_max_size' more times on page

#1 Postby Guest » Jan 31, 2007 2:37 pm

Hi again,

Still having a lot of fun with XUpload :-)

I'm now trying to intergrate the "Upload_form" part in my main index.html page (it's allready working nice), howeven I would like to show the 'x_max_files' and 'x_max_size' at an other place on the index as well.

Now when I copy the code:

Code: Select all

"<font id='x_max_files'>1</font> files<font id='x_max_size'></font> maximum"
and put it at the other place, it does work, but it stopped working on the original place (it's only showing 1 files maximum).

Is there an easy fix for this?

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

#2 Postby PilgrimX182 » Feb 01, 2007 6:45 am

You can't have more than 1 XUpload form on one page right now.

Guest
Posts: 18
Joined: Jan 30, 2007 10:41 pm

#3 Postby Guest » Feb 01, 2007 12:53 pm

That's to bad, but not really a big problem.

All I need to do is hard code the 'x_max_files' and 'x_max_size' values on the page..

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

#4 Postby PilgrimX182 » Feb 01, 2007 1:37 pm

I don't think this would help. Cause both forms will use same iframe for upload so second will interrupt first if start sumultaneously.

I think this hack will work for showing max in both forms:
replace in xupload.js:

Code: Select all

document.getElementById('x_max_files').innerHTML = max_files;
document.getElementById('x_max_size').innerHTML = " ("+max_size+" Mb total)";
with

Code: Select all

var arr1 = document.getElementById('x_max_files');
arr1[0].innerHTML = max_files;
arr1[1].innerHTML = max_files;

var arr2 = document.getElementById('x_max_size');
arr2[0].innerHTML = " ("+max_size+" Mb total)";
arr2[1].innerHTML = " ("+max_size+" Mb total)";

Guest
Posts: 18
Joined: Jan 30, 2007 10:41 pm

#5 Postby Guest » Feb 01, 2007 1:58 pm

Thank you PilgrimX182,

The "hack" does not work. It's giving an Error: '0' is null or not an object

I'll see what you are trying to do, and I'll do some 'custom' hacking on the xupload.js later today to see if I can get it to work.