Hi all,
anyone has an idea why IE is not uploading file and FF does? I'm creating a FORM + IFRAME using DOM and trying to upload a file, now Firefox and Chrome do thins perfectly.
I have attached a Log from HTTPAnalyzer.
Anyhow, here's the code I'm running, Class File: - HTMLElement.Upload = function(Params)
-
{
-
var FORM = new HTMLElement(HTMLElement.FORM,{
-
id: 'FO_'+Params.Id,
-
action: Params.Handler,
-
method: 'post',
-
enctype: 'multipart/form-data',
-
target: 'FR_'+Params.Id
-
});
-
var IFRAME = new HTMLElement(HTMLElement.IFRAME,{
-
name: 'FR_'+Params.Id,
-
id: 'FR_'+Params.Id,
-
width: 0,
-
height: 0,
-
border: 0
-
});
-
IFRAME.name = 'FR_'+Params.Id;
-
IFRAME.style.display = 'none';
-
document.body.appendChild(IFRAME);
-
-
if(!Params.MaxFileSize)
-
{
-
Params.MaxFileSize = 10485760;
-
}
-
-
FORM.appendChild(new HTMLElement(HTMLElement.INPUT,{
-
type: 'hidden',
-
name: 'MAX_FILE_SIZE',
-
value: Params.MaxFileSize
-
}));
-
-
if(Params.File)
-
{
-
FORM.appendChild(new HTMLElement(HTMLElement.INPUT,{
-
type: 'file',
-
name: Params.File,
-
id: 'FI_'+Params.Id,
-
onchange: function()
-
{
-
document.getElementById('FR_'+this.id.substring(3)).onload = function()
-
{
-
if(document.getElementById('FO_'+this.id.substring(3)))
-
{
-
document.getElementById('FO_'+this.id.substring(3)).innerHTML = '<i>Done</i>';
-
}
-
};
-
this.parentNode.submit();
-
-
var SPAN = new HTMLElement(HTMLElement.SPAN,{});
-
SPAN.appendChild(new HTMLElement(HTMLElement.IMG,{
-
src: HTMLElement.CONFIG.IMAGE_UPLOAD_LOADER.src,
-
width: HTMLElement.CONFIG.IMAGE_UPLOAD_LOADER.width,
-
height: HTMLElement.CONFIG.IMAGE_UPLOAD_LOADER.height
-
}));
-
SPAN.appendChild(new HTMLElement(HTMLElement.SPAN,{
-
innerHTML: ' Uploading file \"'+this.value+'\"...</i>'
-
}));
-
this.parentNode.innerHTML = SPAN.innerHTML;
-
}
-
}));
-
}
-
else if(Params.Files)
-
{
-
for(var i in Params.Files)
-
{
-
FORM.appendChild(new HTMLElement(HTMLElement.INPUT,{
-
type: 'file',
-
name: i
-
}));
-
}
-
}
-
return FORM;
-
}
HTMLElement constructor: - function HTMLElement(aElement, Params)
-
{
-
if((aElement == HTMLElement.IFRAME ||
-
aElement == HTMLElement.INPUT) &&
-
HTMLElement.ISIE)
-
{
-
var ParamsString = '';
-
if(Params.name)
-
{
-
ParamsString += ' name="'+Params.name+'"';
-
}
-
if(Params.type)
-
{
-
ParamsString += ' type="'+Params.type+'"';
-
}
-
var aElement = document.createElement('<'+aElement+ParamsString+'>');
-
}
-
else
-
{
-
var aElement = document.createElement(aElement);
-
}
-
for(var i in Params) aElement[i] = Params[i];
-
return aElement;
-
}
And the code I run is: -
window.onload = function(){
-
HTMLElement.onload = function()
-
{
-
HTMLElement.ConvertSelectsToDropdowns();
-
document.getElementById('vvv').appendChild(new HTMLElement.Upload({
-
Id: 'upl',
-
File: 'uploadedfile',
-
Handler: 'ESCMS_HTMLElement/upload.php'
-
}));
-
}
-
new HTMLElement.Include(HTMLElement.CLASS_BOX);
-
new HTMLElement.Include(HTMLElement.CLASS_DROPDOWN);
-
new HTMLElement.Include(HTMLElement.CLASS_AJAX);
-
new HTMLElement.Include(HTMLElement.CLASS_UPLOAD);
-
-
}
-
Thanks in advance
1 4377
I've not tested your code, but do you get any errors? Here's one that should work.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Muppy |
last post by:
I've created a page with a form to upload files:
<h1>Upload di un file</h1>
<form enctype="multipart/form-data" method="post" action="do_upload1.php">
<p><strong>File da trasferire:</strong><br>...
|
by: Selena |
last post by:
I have vb.net windows application which need to upload file to server. It can run properly without using VPN. How can I run it with VPN? Is there any components or code to upload file? Or is there...
|
by: new to add-in |
last post by:
In asp.net/c#, it's easy to implement Upload file to web server, just use
Request.Files or Request.InputStream & runat=server form and type=file input
controls. But now, it's a problem for me how...
|
by: bienwell |
last post by:
Hi all,
I developed an web page in ASP.NET to upload file into the server. In the
Web.config file, I declared
<httpRuntime executionTimeout="1200" maxRequestLength="400000" />
The MAX...
|
by: wasif |
last post by:
I am trying to upload file using ajax and php but having some problems. it always says that there was a problem and file is not uploaded. here is the code
form and ajax code
<!DOCTYPE html...
|
by: suresh_nsnguys |
last post by:
Hi,
I am working in digital signage application where user can upload image,flash and movie files .and later thay can view the uploaded files in digital LCD screen.
I am facing 1...
|
by: google.com |
last post by:
Hi there!
I've been digging around looking for a sample on how to upload a file
without user action. I found the following article covering the area:
...
|
by: |
last post by:
Hi, I use upload control, how to enable upload *.pdf file and enlarge file
size? Please help.
|
by: BigZero |
last post by:
Hello,
i m using apache server and php 5.2.2-3 i need to upload fle well that
part i did, the problem is i can upload a file of limit that is less
then 2mb i can't upload file that as more then...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |