D
db
Hi@all,
I am always thinking that there is no problems that I can not solve.
But now i changed my idea......
My problem is that i use javascript to generate a form, the form
contains a normal file uploader. The code is somehow like this:
var inputform = document.getElementById('inputform');
if (!inputform) {
inputform = document.createElement('form');
inputform.setAttribute('enctype','multipart/form-data');
inputform.setAttribute('method','post');
inputform.setAttribute('action', 'programMotes.php');
filetext=document.createTextNode(' Mote Executable: ');
exefile=document.createElement('input');
exefile.setAttribute('type', 'file');
exefile.setAttribute('name', 'moteProgramFile');
text2=document.createTextNode(' ');
inputButton=document.createElement('input');
inputButton.setAttribute('type', 'submit');
inputButton.setAttribute('value', 'Flash the marked motes');
hidden = document.createElement('input');
hidden.setAttribute('type', 'hidden');
hidden.setAttribute('name', 'sent');
hidden.setAttribute('value', 'true');
inputform.appendChild(tbl);
inputform.appendChild(filetext);
inputform.appendChild(exefile);
inputform.appendChild(text2);
inputform.appendChild(inputButton);
inputform.appendChild(hidden);
br=document.createElement('br');
br2=document.createElement('br');
finishedText=document.createTextNode('Loaded.');
inputform.insertBefore(br, filetext);
inputform.insertBefore(finishedText, br);
inputform.insertBefore(br2, finishedText);
content.appendChild(inputform);
}
And then in corresponding php file moteProgramFile.php:
$target_path = "uploads/";
$target_path = $target_path .
basename($_FILES['moteProgramFile']['name']);
echo $target_path;
if(move_uploaded_file($_FILES['moteProgramFile']['tmp_name'],
$target_path))
{
echo "The file ". basename( $_FILES['moteProgramFile']['name']).
" has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
With using firefox, there is absolutely no problem, but with using IE,
the file can just not be uploaded! Does someone have an idea?
thanks in advance
db
I am always thinking that there is no problems that I can not solve.
But now i changed my idea......
My problem is that i use javascript to generate a form, the form
contains a normal file uploader. The code is somehow like this:
var inputform = document.getElementById('inputform');
if (!inputform) {
inputform = document.createElement('form');
inputform.setAttribute('enctype','multipart/form-data');
inputform.setAttribute('method','post');
inputform.setAttribute('action', 'programMotes.php');
filetext=document.createTextNode(' Mote Executable: ');
exefile=document.createElement('input');
exefile.setAttribute('type', 'file');
exefile.setAttribute('name', 'moteProgramFile');
text2=document.createTextNode(' ');
inputButton=document.createElement('input');
inputButton.setAttribute('type', 'submit');
inputButton.setAttribute('value', 'Flash the marked motes');
hidden = document.createElement('input');
hidden.setAttribute('type', 'hidden');
hidden.setAttribute('name', 'sent');
hidden.setAttribute('value', 'true');
inputform.appendChild(tbl);
inputform.appendChild(filetext);
inputform.appendChild(exefile);
inputform.appendChild(text2);
inputform.appendChild(inputButton);
inputform.appendChild(hidden);
br=document.createElement('br');
br2=document.createElement('br');
finishedText=document.createTextNode('Loaded.');
inputform.insertBefore(br, filetext);
inputform.insertBefore(finishedText, br);
inputform.insertBefore(br2, finishedText);
content.appendChild(inputform);
}
And then in corresponding php file moteProgramFile.php:
$target_path = "uploads/";
$target_path = $target_path .
basename($_FILES['moteProgramFile']['name']);
echo $target_path;
if(move_uploaded_file($_FILES['moteProgramFile']['tmp_name'],
$target_path))
{
echo "The file ". basename( $_FILES['moteProgramFile']['name']).
" has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
With using firefox, there is absolutely no problem, but with using IE,
the file can just not be uploaded! Does someone have an idea?
thanks in advance
db