Ask a Question related to ASP, Design and Development.

  1. #1

    Default file field

    Hi,
    In the file field <input type="file" name="file1">, can I modify the button
    "Browse..."?
    I want to hide the file field but show a button like "Open". When I click on
    this button, it catches a file, and use onchange even to upload this file.
    thanks for any idea.
    Atse



    atse Guest

  2. Similar Questions and Discussions

    1. Help with FILE FIELD Problem
      hello I am building a page in form mail page in HTMXL cgi/formmail POST encytype is application/x-www-form-urlencoded. I am collecting names...
    2. File Field Confusion
      Please can someone tell me how to make the "file field" in dreamweaver work. What i'm trying to do is have anyone that enters the site to put a...
    3. File Field Confusion!
      :confused; I've been trying to find out how to get "file field" on my forms to work for a while now. I really cant figure this out. Could somebody...
    4. How to get binary file from SQL field?
      I want to display binary data from SQL server 2000 in an asp page. The data comes from a Windows Sharepoint Services document library. The raw...
    5. File Field Control
      hie all, i have dragged a File Field control from the HTML tab to my page and i am able to browse and retrieve the file i want. the only problem i...
  3. #2

    Default Re: file field

    I'm afraid you can't modify that button in current browsers

    IIRC, though, there are tricks you can do with CSS layers which might be
    able to mask it...


    --
    Atrax, MVP, IIS

    [url]http://rtfm.atrax.co.uk/[/url]

    "atse" <dunggaze@yahoo.com> wrote in message
    news:ooJjb.356656$Lnr1.181446@news01.bloor.is.net. cable.rogers.com...
    > Hi,
    > In the file field <input type="file" name="file1">, can I modify the
    button
    > "Browse..."?
    > I want to hide the file field but show a button like "Open". When I click
    on
    > this button, it catches a file, and use onchange even to upload this file.
    > thanks for any idea.
    > Atse
    >
    >
    >

    Atrax Guest

  4. #3

    Default Re: file field

    Hi, Atse

    Please see the code bellow. It uses customized button, you can also use
    an image or other HTML element to browse files.
    There is one difference with this code and plain type=file field -
    client must select file from browse window, cannot copy full path to the
    text field.


    Antonin
    See Pure/Huge ASP upload ([url]http://www.pstruh.cz[/url]) to accept uploaded file
    in ASP :-)

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <Script Language='Javascript'>
    function validateFile()
    {
    document.frm.Image.click();
    var sTmpString = new String(document.frm.Image.value);

    var iPos = sTmpString.lastIndexOf("\\");

    document.frm.txt.value = sTmpString.substring(iPos+1,sTmpString.length);

    }
    </Script>
    </HEAD>
    <BODY>
    <form name="frm">
    <input type="file"
    name="Image" size="20"
    onChange="validateFile();" style="visibility:hidden;">
    <input type="text" name="txt">
    <input type="button" value="Browse ..."
    onMouseDown="validateFile();">
    </form>
    </BODY>
    </HTML>

    "atse" <dunggaze@yahoo.com> wrote in message
    news:ooJjb.356656$Lnr1.181446@news01.bloor.is.net. cable.rogers.com...
    > Hi,
    > In the file field <input type="file" name="file1">, can I modify the
    button
    > "Browse..."?
    > I want to hide the file field but show a button like "Open". When I click
    on
    > this button, it catches a file, and use onchange even to upload this file.
    > thanks for any idea.
    > Atse

    Antonin Foller Guest

  5. #4

    Default Re: file field

    Thanks Antonin, but it doesn't work for me, because no file is passed to
    upload. I enable Image's visibility, and found the path there. When I click
    on the submit button once, the path is clear on the Image field, and the
    form doesn't submit. In another word, click once the submit button, the form
    doesn't submit, but the Image field is clear the path. Any idea?
    atse

    "Antonin Foller" <antonin@foller.cz> wrote in message
    news:u%23hnSsNlDHA.2000@TK2MSFTNGP12.phx.gbl...
    > Hi, Atse
    >
    > Please see the code bellow. It uses customized button, you can also
    use
    > an image or other HTML element to browse files.
    > There is one difference with this code and plain type=file field -
    > client must select file from browse window, cannot copy full path to the
    > text field.
    >
    >
    > Antonin
    > See Pure/Huge ASP upload ([url]http://www.pstruh.cz[/url]) to accept uploaded
    file
    > in ASP :-)
    >
    > <HTML>
    > <HEAD>
    > <TITLE></TITLE>
    > <Script Language='Javascript'>
    > function validateFile()
    > {
    > document.frm.Image.click();
    > var sTmpString = new String(document.frm.Image.value);
    >
    > var iPos = sTmpString.lastIndexOf("\\");
    >
    > document.frm.txt.value = sTmpString.substring(iPos+1,sTmpString.length);
    >
    > }
    > </Script>
    > </HEAD>
    > <BODY>
    > <form name="frm">
    > <input type="file"
    > name="Image" size="20"
    > onChange="validateFile();" style="visibility:hidden;">
    > <input type="text" name="txt">
    > <input type="button" value="Browse ..."
    > onMouseDown="validateFile();">
    > </form>
    > </BODY>
    > </HTML>
    >
    > "atse" <dunggaze@yahoo.com> wrote in message
    > news:ooJjb.356656$Lnr1.181446@news01.bloor.is.net. cable.rogers.com...
    > > Hi,
    > > In the file field <input type="file" name="file1">, can I modify the
    > button
    > > "Browse..."?
    > > I want to hide the file field but show a button like "Open". When I
    click
    > on
    > > this button, it catches a file, and use onchange even to upload this
    file.
    > > thanks for any idea.
    > > Atse
    >
    >

    atse Guest

  6. #5

    Default Re: file field

    Yes, the browser doesn't allow this. Although you might be able to
    hide the input with a layer or something, you won't be able to pre-set
    the file that you want uploaded. You need to use an applet or other
    client control like ActiveX to supplement the browser security
    limitations.
    -Tom
    "Atrax" <atrax@dontspamatrax.co.uk> wrote in message news:<u35TqbGlDHA.2456@TK2MSFTNGP09.phx.gbl>...
    > I'm afraid you can't modify that button in current browsers
    >
    > IIRC, though, there are tricks you can do with CSS layers which might be
    > able to mask it...
    >
    >
    > --
    > Atrax, MVP, IIS
    >
    > [url]http://rtfm.atrax.co.uk/[/url]
    >
    > "atse" <dunggaze@yahoo.com> wrote in message
    > news:ooJjb.356656$Lnr1.181446@news01.bloor.is.net. cable.rogers.com...
    > > Hi,
    > > In the file field <input type="file" name="file1">, can I modify the
    > button
    > > "Browse..."?
    > > I want to hide the file field but show a button like "Open". When I click
    > on
    > > this button, it catches a file, and use onchange even to upload this file.
    > > thanks for any idea.
    > > Atse
    > >
    > >
    > >
    Tom Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139