File Input Problem, please help, specific to XP SP2

Discussion in 'Javascript' started by Alon Zilkha, Sep 29, 2004.

  1. Alon Zilkha

    Alon Zilkha Guest

    Hi All,

    I just noticed a problem with Internet Explorer on Service Pack 2 of Windows
    XP and it is driving me insane!! I would greatly appreciate it if someone
    could help me out...

    I have a basic asp file (test.asp) with the following code:

    ----------------------------------------
    <%
    Response.Write(Request.Form("testalon"))
    %>

    <form name=yo method="post" action="test.asp">
    <input type=file name=testalon>
    <input type=button value=submit onclick="javascript:yo.submit();">
    </form>
    ----------------------------------------

    When I click on the submit button, I get the following Script Error:
    "Access is Denied"

    However, if I change the input to a text input rather than a file input,
    everything works fine...

    This does not happen with all previous versions of IE!!! (before Windows XP
    Service pack 2). Does anyone know how to get around this (perhaps a setting
    in IE) ? It will be difficult for me to switch all my code to text inputs
    rather than file inputs since they are used so frequently...

    Thanks,
    Alon
     
    Alon Zilkha, Sep 29, 2004
    #1
    1. Advertisements

  2. Try using a real submit button
    <input type=submit value=submit>

    Regards,
    Steve
     
    Steve van Dongen, Sep 29, 2004
    #2
    1. Advertisements

  3. Alon Zilkha

    Alon Zilkha Guest

    Thanks for the reply Steve. I actually tried that earlier but had no luck.
    Very interesting, with a submit button the form doesn't submit (and there's
    no error either), but when I change the field to a regular text box it
    submits just fine...

    Alon
     
    Alon Zilkha, Sep 29, 2004
    #3
  4. Alon Zilkha

    Alon Zilkha Guest

    So no one has any ideas???
     
    Alon Zilkha, Oct 3, 2004
    #4
  5. Alon Zilkha

    Randy Webb Guest

    Please don't top-post. Read the FAQ with regards to such.



    <input type="submit" value="submit">

    Why are you using JS to duplicate something the browser will already do
    on its own?
     
    Randy Webb, Oct 3, 2004
    #5
  6. Alon Zilkha

    Alon Zilkha Guest

    Sorry for the top post.

    The example that I gave was a very basic snippet taken from a much larger
    collection of code. So I can't easily explain why I am using a javascript
    call to submit the form rather than a regular submit button.

    Anyway, the problem still remains (whether using JS or using the browser). I
    cannot submit a form that contains a file input..

    Any help would be very much appreciated.

    Thanks,
    Alon
     
    Alon Zilkha, Oct 3, 2004
    #6
  7. Well, it is easy to explain why doing so doesn't make much sense:
    your page does not work for anyone who has disabled scripting. If you
    run other script code when submitting the form it should be done in an
    onsubmit event handler; return true or false to submit or not submit
    the form respectively.

    <form name=yo method="post" action="test.asp" onSubmit="return
    DoBeforeSubmit(this)">
    <input type=submit value=submit>

    In any case,
    onclick="javascript:yo.submit();"
    is wrong. It should be
    onclick="yo.submit();"
    What is the rest of your script doing? Does it affect the file input
    element at all? There were some security fixes in this area.

    Regards,
    Steve
     
    Steve van Dongen, Oct 3, 2004
    #7
  8. Alon Zilkha

    Randy Webb Guest

    One would think that a person associated (or posting from) a university
    (University of Texas), would refrain from top-posting to apologize for
    top-posting. Is that the mentality they teach in college these days?
    Ignorance is usually the best defense. "I didn't know any better".
    Otherwise, using JS to duplicate basic browser functionality is very
    very flawed.

    Then something else in your script is the problem. IE6 on XP SP2 will
    submit a file input just fine (I have tested it locally and it doesn't
    give me any errors). But I fail to see how a non-JS page can throw a JS
    error when there is no JS on the page. If you had narrowed it down to
    the smallest test case possible, that becomes obvious.

    Read the FAQ. All of it.
     
    Randy Webb, Oct 3, 2004
    #8
  9. Alon Zilkha

    Alon Zilkha Guest

    You guys need to pull the sticks out of your own asses... Ok, I
    misunderstood what top posting was and repeated the mistake... Haha very
    funny... and I'm from the University of Texas. 'How can a UT student not
    understand what top-posting means??' GASSSPPP.

    Why don't you all SHUT THE HELL UP. I am out of this forum... You're all so
    useless. You have nothing better to do than sit around these forums being
    rude to people, because you're such fucking pussies in every day life and
    can't express yourself outside in the real world...
     
    Alon Zilkha, Oct 4, 2004
    #9
  10. On Sun, 3 Oct 2004 23:19:23 -0500, Alon Zilkha

    [snip]
    And it's good of you to admit that, but why didn't you say so in the first
    place? You're new. It's expected that you might not understand the way
    things are done. If you enquired, "What is top posting?", someone would
    have explained, or pointed to a resource that did so, and might even had
    mentioned why it's frowned upon.

    As it happens, Andrew did just that.
    No-one's laughing at you or trying to make you look like a fool.
    Don't be facetious. Common etiquette on Usenet is to find the FAQ for the
    group in question (Googling for the group name and 'FAQ' will usually
    locate it), read it, and note how regular posters act and respond. It
    tends to be a good indication of how to behave.
    You've interacted with just three responders, yet you seek to comment on
    everyone? A little unfair, don't you think? Furthermore, I don't think
    you've actually provided enough information to yield a helpful response so
    far.

    As Randy suggested, simplify the problem. Produce a very small, HTML-only
    document with a form and a file input. See what happens. If there are no
    problems with that, then it lies with something in the current code. Try
    moving incrementally towards that version and you should find the cause.
    If there are problems with the simple case, then it's more likely that
    either the browser or the server is at fault.
    I'm interested to know how you can sensibly make such an accusation. So
    far, no-one has swore, no-one has insulted you, so your attack in
    unprevoked. Randy has been terse, yes, but I am too. It's just a posting
    style. It certainly doesn't warrant your actions.

    If you want to act in a civilised manner, someone will help you. If you
    don't, you'll be killfiled and ignored in perpetuity. Your choice.

    Mike
     
    Michael Winter, Oct 4, 2004
    #10
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.