SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Upload File

  1. #1
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Upload File

    Hello! I hope u can help me...

    How do i upload a file without the input type file...its the the attach file button of yahoo mail. or is it hidden? either way can u give me some insight about this?

    Thanks!

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you cannot upload a file without using the file input, but what you can do is use javascript (I think) to replicate the user clicking on the browse button etc .


  3. #3
    SitePoint Enthusiast szigeti's Avatar
    Join Date
    May 2005
    Location
    Hungary
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is an informative article about the problem of styling a file input.

    http://www.quirksmode.org/dom/inputfile.html

    Basically you need to hide the input field via css (setting its opacity to zero), and position above your nice upload button.
    Eat healthy,
    Exercise daily,
    Die anyway.

  4. #4
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks! guys! i hope more guys can help me out..

  5. #5
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by szigeti View Post
    Here is an informative article about the problem of styling a file input.

    http://www.quirksmode.org/dom/inputfile.html

    Basically you need to hide the input field via css (setting its opacity to zero), and position above your nice upload button.
    the problem with this solution is that .click() doesnt work in firefox..

  6. #6
    SitePoint Enthusiast szigeti's Avatar
    Join Date
    May 2005
    Location
    Hungary
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cachobong View Post
    the problem with this solution is that .click() doesnt work in firefox..
    Just position the invisible file input's button just above your graphical button, and everything should work. You only have to mask the file input's textfield somehow, so the user cannot accidentally click on it. Of course you would have to find a way to display the selected file's name, and offer a solution to remove the selected file.

    You still would have problems because there is no way to set the dimensions of the button on the original file input (the text on it depends on the browser and the language of the operating system), but currently the only satisfying solution would be to use Flash for file uploads, and of course this is not an option in every case.

    Form fields are very hard to tame.
    Eat healthy,
    Exercise daily,
    Die anyway.

  7. #7
    SitePoint Zealot cachobong's Avatar
    Join Date
    Jan 2005
    Location
    cebu
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by szigeti View Post
    Just position the invisible file input's button just above your graphical button, and everything should work. You only have to mask the file input's textfield somehow, so the user cannot accidentally click on it. Of course you would have to find a way to display the selected file's name, and offer a solution to remove the selected file.

    You still would have problems because there is no way to set the dimensions of the button on the original file input (the text on it depends on the browser and the language of the operating system), but currently the only satisfying solution would be to use Flash for file uploads, and of course this is not an option in every case.

    Form fields are very hard to tame.
    that was wat i was thinking.. hehe.. flash!


Bookmarks

Posting Permissions

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