"Acces denied" error when sending form with files attached
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   robert_baboi
Posted On:   Thursday, September 21, 2006 04:44 AM

Hello, I have a rather nasty bug. Here is may scenario. I am using dojo library to pass forms with files to the server(upload files). The input nodes are all added dinamic from javascript. When I add the nodes to DOM I also set the name property. All is ok so far. BUT, when i call the method to send the request I get a acces denied error. Here is my code: function addFile(){ var uploadForm=document.getElementById("uploadForm"); var newinput=" "; uploadForm.innerHTML=uploadForm.innerHTML+newinput; document.getElementById(idnewf).click(); } function sendIt() { dojo.io.bind ({ url: 'http://127.0.0.1:8080/JSFOne/upload.   More>>

Hello,


I have a rather nasty bug. Here is may scenario.


I am using dojo library to pass forms with files to the server(upload files). The input nodes are all added dinamic from javascript. When I add the nodes to DOM I also set the name property. All is ok so far. BUT, when i call the method to send the request I get a acces denied error.


Here is my code:



			
function addFile(){
var uploadForm=document.getElementById("uploadForm");
var newinput=" ";
uploadForm.innerHTML=uploadForm.innerHTML+newinput;
document.getElementById(idnewf).click();
}
function sendIt() {
dojo.io.bind ({
url: 'http://127.0.0.1:8080/JSFOne/upload.ajx',
method: "post",
mimetype:"text/javascript",
formNode: uploadForm,
handler: callBack
});
}

When the addFile() method is called everythig works fine, but when the sendIt() method is called I get the error, and the line where the error is thown is somewhere in the dojo.js file.


I tryed not to set the name attribute and the error doesn't appear, but the upload doesn't work in this case.


My thought is that dojo is trying to get the file node from the form and added it to the request body but can't acces the name field.


The trikie thing is that if I add the input fields static( in html , not with javascript) its working just fine. So i don't undestand what is the difference between adding them dinamicaly or not.


If you have any ideea or have encountered this sitution before please replay, any sugestion is appreciated. Thanks, and sorry for my bad english.



PS: Although my problem may be related more to dojo, its still ajax based, thats why i posted it in the ajax forum

   <<Less
About | Sitemap | Contact