INPUT type=file problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Hinds

    INPUT type=file problem

    I have the following code on my ASP page:

    <INPUT type=file name="FileUploa d" value="<%=FileN ame%>">

    I'm passing the value of FileName as part of the Query String and assigning
    it like so:

    FileName = Request.QuerySt ring("FileName" )

    It is definitely being passed/assigned correctly - I have this line for
    debugging purposes:

    Response.Append ToLog "FileName=" & FileName

    which outputs the following in the webserver log file (abbreviated for
    space):

    GET /content/UploadDB.asp FileName=D:\Dat abase\ClassTool .mdb 200

    The question is - why isn't the file name showing up in the INPUT box?



  • Bob Barrows [MVP]

    #2
    Re: INPUT type=file problem

    Ron Hinds wrote:[color=blue]
    > I have the following code on my ASP page:
    >
    > <INPUT type=file name="FileUploa d" value="<%=FileN ame%>">[/color]

    Modern brwsers will not allow setting the value attribute of INPUT elements
    of type "file", as it's a security hole that could be used by hackers.



    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Comment

    • Ron Hinds

      #3
      Re: INPUT type=file problem

      "Bob Barrows [MVP]" <reb01501@NOyah oo.SPAMcom> wrote in message
      news:eaHQjB4eGH A.3640@TK2MSFTN GP03.phx.gbl...[color=blue]
      > Ron Hinds wrote:[color=green]
      > > I have the following code on my ASP page:
      > >
      > > <INPUT type=file name="FileUploa d" value="<%=FileN ame%>">[/color]
      >
      > Modern brwsers will not allow setting the value attribute of INPUT[/color]
      elements[color=blue]
      > of type "file", as it's a security hole that could be used by hackers.
      >
      >
      >
      > --
      > Microsoft MVP - ASP/ASP.NET
      > Please reply to the newsgroup. This email account is my spam trap so I
      > don't check it very often. If you must reply off-line, then remove the
      > "NO SPAM"[/color]

      Thanks - that, at least, explains it! I was just trying to provide
      convenience for my end users but I guess they will have to "suffer" ;-)



      Comment

      • Rob Meade

        #4
        Re: INPUT type=file problem

        "Ron Hinds" wrote ...
        [color=blue]
        > Thanks - that, at least, explains it! I was just trying to provide
        > convenience for my end users but I guess they will have to "suffer" ;-)[/color]

        I faced the same problem a few years back - there is a way around it - but
        not just by popping the value into the box...

        Take a look at the SoftArtisans website (www.softartisans.com) - we use the
        SA-FileUp product, and in one application in conjunction with XFile (another
        of their products) - this will allow this to be done as it'll use their
        component as opposed to the standard INPUT box...

        Of course, this might all be more effort than you want make, I know it felt
        that way for me - which is why I kept re-iterating to my boss that it
        couldn't be done - alas - he didn't have any of it and we got the component.
        In our scenario - we use it "blindly" - ie, we just pass the component a
        file name and it simply takes it from the users PC and starts the upload
        process (this is used on our corporate network as opposed to on a www
        environment so a little naughty)...I seem to remember that there were
        options for whether the process was hidden or not...

        Regards

        Rob


        Comment

        Working...