Access Denied in IE 6 using HTTPS and File Upload

Discussion in 'Javascript' started by DA, Nov 30, 2004.

  1. DA

    DA Guest

    Hello,

    I'm hoping someone can help me here. I've got a form that when placed on
    a server running HTTPS, I get an "access denied" error in IE 6 (non-SP2
    and SP-2) when a user tries to upload an image using a file upload form
    control.

    I read something about the onClick() event handler causing it, but I've
    yet to see a fix or workaround for this. I've posted the form and
    JavaScript below.

    Thanks for any help anyone can provide,

    -DA

    <form name="myForm" enctype="multipart/form-data"
    action="index.cfm?Action=PhotoUpload" method="post">
    <label for="taDescription">Description:</label>
    <br />
    <textarea id="taDescription" name="description"></textarea>
    <p />
    <label for="fuFile">Photo to upload:</label>
    <br />
    <input id="fuFile" name="upFile" type="file" />
    <br />
    <input type="button" value="Send Now" onClick="submitForm()" />
    </form>

    <script language="JavaScript">
    <!--
    function submitForm()
    {
    if (!document.myForm.upFile.value.length)
    {
    alert("Please select a file to upload.");
    return false;
    }
    if (!document.myForm.description.value.length)
    {
    alert("Description is required for accessibility.");
    return false;
    }
    document.myForm.submit();
    }
    // -->
    </script>
     
    DA, Nov 30, 2004
    #1
    1. Advertising

  2. DA <> wrote:

    >Hello,
    >
    >I'm hoping someone can help me here. I've got a form that when placed on
    >a server running HTTPS, I get an "access denied" error in IE 6 (non-SP2
    >and SP-2) when a user tries to upload an image using a file upload form
    >control.
    >
    >I read something about the onClick() event handler causing it, but I've
    >yet to see a fix or workaround for this.


    Don't submit the form using script. Submit using a submit button and
    do the validation in an onSubmit handler.

    ><form name="myForm" enctype="multipart/form-data"
    > action="index.cfm?Action=PhotoUpload" method="post">


    <form ... onsubmit="return validateForm(this)">

    > <label for="taDescription">Description:</label>
    > <br />
    > <textarea id="taDescription" name="description"></textarea>
    > <p />
    > <label for="fuFile">Photo to upload:</label>
    > <br />
    > <input id="fuFile" name="upFile" type="file" />
    > <br />
    > <input type="button" value="Send Now" onClick="submitForm()" />


    <input type="submit" value="Send Now" />

    ></form>
    >
    ><script language="JavaScript">
    ><!--


    <!-- comment is unnecessary

    function validateForm(form)
    {
    if (!form.upFile.value.length)
    {
    alert("Please select a file to upload.");
    return false;
    }
    if (!form.description.value.length)
    {
    alert("Description is required for accessibility.");
    return false;
    }

    return true;
    }

    Regards,
    Steve
     
    Steve van Dongen, Nov 30, 2004
    #2
    1. Advertising

  3. DA

    DA Guest

    Thanks, Steve -- it worked like a charm.

    Much appreciated!

    -DA

    Steve van Dongen wrote:
    > DA <> wrote:
    >
    >
    >>Hello,
    >>
    >>I'm hoping someone can help me here. I've got a form that when placed on
    >>a server running HTTPS, I get an "access denied" error in IE 6 (non-SP2
    >>and SP-2) when a user tries to upload an image using a file upload form
    >>control.
    >>
    >>I read something about the onClick() event handler causing it, but I've
    >>yet to see a fix or workaround for this.

    >
    >
    > Don't submit the form using script. Submit using a submit button and
    > do the validation in an onSubmit handler.
    >
    >
    >><form name="myForm" enctype="multipart/form-data"
    >> action="index.cfm?Action=PhotoUpload" method="post">

    >
    >
    > <form ... onsubmit="return validateForm(this)">
    >
    >> <label for="taDescription">Description:</label>
    >> <br />
    >> <textarea id="taDescription" name="description"></textarea>
    >> <p />
    >> <label for="fuFile">Photo to upload:</label>
    >> <br />
    >> <input id="fuFile" name="upFile" type="file" />
    >> <br />
    >> <input type="button" value="Send Now" onClick="submitForm()" />

    >
    >
    > <input type="submit" value="Send Now" />
    >
    >></form>
    >>
    >><script language="JavaScript">
    >><!--

    >
    >
    > <!-- comment is unnecessary
    >
    > function validateForm(form)
    > {
    > if (!form.upFile.value.length)
    > {
    > alert("Please select a file to upload.");
    > return false;
    > }
    > if (!form.description.value.length)
    > {
    > alert("Description is required for accessibility.");
    > return false;
    > }
    >
    > return true;
    > }
    >
    > Regards,
    > Steve
     
    DA, Nov 30, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=

    access denied error for file upload

    =?Utf-8?B?aWdvdHlvdXJkb3RuZXQ=?=, Sep 28, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    4,778
    Steven Cheng[MSFT]
    Sep 29, 2006
  2. tom
    Replies:
    0
    Views:
    640
  3. jpandviv
    Replies:
    1
    Views:
    396
    bruce barker
    Sep 13, 2007
  4. Pedro Rafael

    file upload(htmlfile: access is denied)

    Pedro Rafael, Sep 22, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    391
  5. Cindy Lee
    Replies:
    1
    Views:
    427
    Randy Webb
    May 7, 2004
Loading...

Share This Page