Horizon88 wrote:

http://www.michaelmcgrady.com/file_browse_images.jsp , but the first link is a bit more coherent, IMO. There really does need to be a better way to style these though.

His "Solution" works in Firefox, but not on my IE 6. The submit button is styled, but the browse... button is the default IE. In Firefox they are both styled with that solution.

The CSS forums I searched generally say "Can't be done".

The one workaround that does work is embedding a flash based uploader, which you can style however you would like. There are quite a few references to a premade .swf module for this, but the links seem to be dead for me.

Here is the "Howto" in Adobe Flash:

http://livedocs.adobe.com/flash/9.0/main/00001054.html

    Thanks for the research guys...

    The CSS attribute selector doesn't seem to be working either...does the same thing as setting a class to the input:

    <html>
    <body>
    <head>
    <style>
    input[type='file'] {
      background: green;
    }
    </style>
    </head>
    <body>
    <form>
     <input type="file" name="fileName">
    </form>
    </body>
    </html>
    

    That kludge does sound like a bit much. All I really care about is Firefox for this particular project. I guess it's time to roll up my sleeves and contribute and go tackle that firefox source code eh? (kidding there).

      It can be done.. Check Relay file manager. Works both in IE and Firefox(havent tested Opera and the others though).

        No thanks. I just want to change my button's appearance.

          Horizon88 wrote:

          Sometimes I think he just posts whatever he can think of to increase his post count.

          He replies to every thread on the board, and normally it's some garbled "test" he wants you to run, with a snide remark about using something already written "100reds and 100reds" of times already. It's like a 60/40 shot he actually has any idea what he's talking about most times.

          Horizon88, your opinion is noted, man.

          I couldnt care less about post count.
          What I care about is those asking questions, and waiting for an answer.
          In words/terms they can understand, even if they are Newbies.
          An those are the ones I feel I can help the most.
          I leave the more advanced stuff to you, Weedpacket, laserlight, NogDog and our more experienced PHPCoders.

          You may be think I do not do any good here around.
          I say most thing are in the eye of the beholder.
          There is saying, everyone has 1 good eye and 1 bad eye.
          It is up to each what eye we will use, when look at other person.

          You see what you want to see and you shut your eyes for anything else that doesnt fit you.
          And what you want to see comes from within your heart & soul.
          By this I know a bit more of you as a person. Who you really are.

          A bad tree can not give good fruit.
          By the fruit we can know the tree.

          If the moderators do not want me at phpbuilder, I expect my account to be banned soon as possible.
          But if I have to go, I cant see else, than that there are several that have to go before me and with me.
          I am waiting.

          troybtj wrote:

          His "Solution" works in Firefox, but not on my IE 6. The submit button is styled, but the browse... button is the default IE. In Firefox they are both styled with that solution.

          The CSS forums I searched generally say "Can't be done".

          Yes, right!

          About that submit button, sneakyimp.
          Yes, I have tried to do search for a solution, last year.
          But found nothing.
          And I had just to except to use the default file button style.
          It is no big thing for me.

          Regards
          🙂

            Oi, no need to attack anyone here... everyone's here to help one another as best they can regardless of his/her skill.

            Anyway, back to this thread's initial topic!

            I've always found the security surrounding file input elements to be quite extreme. Too extreme? No clue - I sure don't want any malicious JavaScript coding to manipulate a file input field... but what's wrong with CSS? shrug

            Guess this is another reason to stick to FireFox as being my default browser! :p

              5 days later

              file upload button alteration is only supported in some browsers. You could use a javascript file browsing window (which then inserts the string into a text input and ajax takes it from there), I have seen it done before but i don't remember where.

                If I'm not mistaken, that would be prevented by security features, otherwise someone could script a site that would pilfer your hard drive.

                  If you want to style buttons you must use an image.

                    8 days later

                    Back to top of thread. This no-styling of the browse button bugs me too.
                    Have alook at

                    rubbish reference

                    for a possible solution. I'm not sure how relevant it is to PHP which I do not use but hope it might help. I'm looking at a slightly different tack.

                    Added later:

                    Oops! Dropped out a 'u'! : 'forums' not 'forms'. Sorry about that.

                    The reference is to

                    http://www.dreamincode.net/forums/showtopic15621.htm

                    [ ModEdit - bpat1434 ] Use the edit button next time, no need to double post.

                      Write a Reply...