Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies www.omnytex.com
From: "Ion Iulian" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: Re: Javascript: Access is denied when I try to upload a file Date: Tue, 7 Sep 2004 14:03:36 +0300
Tanck you Frank. If you probably know if i put <input type="file" ID="fileUpload" value="" onchange="javascript:reload()" style="display:none"> instead <html:file property="fileUpload" onchange="javascript:reload()" style="display:none"/> it's working but this is not a struts tag and I have an error in my Servlet java code.
How did you get over this??
----- Original Message ----- From: "Frank Zammetti" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 06, 2004 9:23 PM Subject: RE: Javascript: Access is denied when I try to upload a file
> Nothing is wrong... the browser is exercising some security so that
scripts
> cannot initiate an upload without direct user intervention.
>
> I don't mean to toot my own horn (well, ok, yes I do! :) ) but I am
> generally considered a JavaScript/DHTML guru at work (but not at
home?!?)...
> I've been trying to make this work for a long time, but have never been
able
> to do so. I've never seen posted anywhere a method that makes it work
> either.
>
> I HAVE however seen a recent discussionon this very mailing list about
this
> topic, and it seemed that someone DID have a solution (although I tried
the
> code posted and got close, but still it wouldn't work). If someone
reading
> this knows the thread I'm referring to and has a working example, I for
one
> will happily bow down before you and profess your greatness! :)
>
> In lue of that answer being posted and proving me wrong, I feel pretty
> confident in saying that this can't be done on current browsers (well, in
> truth I can only make that statement with regard to IE, I'm not certain if
> other browsers might allow it somehow).
>
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> www.omnytex.com
>
>
> >From: "Ion Iulian" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Subject: Javascript: Access is denied when I try to upload a file
> >Date: Mon, 6 Sep 2004 18:35:23 +0300
> >
> >Hi. I want to upload a file and I use another button to select the file.
I
> >press the button "Sfoglia", and after the file is selected when I press
> >"Acquisizione" to make submit the following javascript error occur
"Access
> >is denied". What's wrong?? Please help me.
> >
> ><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> ><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> ><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> ><%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> >
> ><head>
> ><title>Uploading form</title>
> ><html:base/>
> ></head>
> ><BODY>
> >
> ><script language="JavaScript">
> >function azione11(azione)
> >{
> > document.forms[0].action=azione;
> >document.forms[0].submit();
> >}
> >
> >function showText(txtId)
> >{
> > if (txtId == "" ){
> > document.getElementById('layer1').style.display='none';
> > document.getElementById('layer2').style.display='none';
> > document.getElementById('textid').style.display='none';
> > document.getElementById('textid').innerHTML="";
> > }
> > else{
> > document.getElementById('layer1').style.display='block';
> > document.getElementById('layer2').style.display='block';
> > document.getElementById('textid').style.display='block';
> > document.getElementById('textid').innerHTML="Foglio excel -
> >"+txtId;
> > }
> >}
> >
> ></script>
> >
> ><html:form action="ricercaEsportazioni.do" enctype="multipart/form-data">
> >
> ><hr width="70%">
> >
> ><div id="layer1" style="display:none" align="center">
> > <table width="70%" border="0" cellPadding="3" cellSpacing="1">
> > <tr>
> > <td width="15%" align="center" nowrap>
> ></div>
> ><font class="output"><div id=textid style="display:none"></div></font>
> ><div id="layer2" style="display:none" align="center">
> > </td>
> > </tr>
> > </table>
> ></div>
> >
> ><hr width="70%">
> ><table width="70%" border="0" cellPadding="3" cellSpacing="1"
> >align="center">
> ><tr>
> > <td align="center">
> > <html:button property="acquisizione"
> >onclick="javascript:document.forms[0].submit()" >
> > Acquisizione
> > </html:button>
> >
> > <html:button property="sfoglia" onclick="fileUpload.click()" >
> > Sfoglia
> > </html:button>
> >
> > <html:file property="fileUpload"
> >onchange="javascript:showText(document.forms[0].fileUpload.value)"
> >style="display:none"/>
> >
> > </td>
> ></tr>
> ></table>
> >
> ></html:form>
> ><html:errors/>
> ></html:html>
> >
> >P.S. I must use style diplay:none at the html:file tag.
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]