SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making thumbnail displayed by input type=file following browse larger

    Once a user has selected a file using the browse button in an <input type="file" /> tag, a thumbnail of the file is displayed in the form along with the file name.

    Is there any way to make that thumbnail larger?

    I am creating an admin page where users will be uploading image files. For older users, the thumbnail displayed is a bit small to really see effectively.

    I want the user to be able to see the thumbnail to make sure they are uploading the correct image before they submit the form.

    --Kenoli

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by kenoli View Post
    Once a user has selected a file using the browse button in an <input type="file" /> tag, a thumbnail of the file is displayed in the form along with the file name.
    Is there any way to make that thumbnail larger?
    That entirely depends on how the thumbnail is being created.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    That entirely depends on how the thumbnail is being created.
    As far as I know, in the default the thumbnail is created by the browser.

    Once posted, I can, of course, create and display a thumbnail of any size from the uploaded image using a server side script.

    I was curious how the default thumbnail which is displayed before a post is submitted is created and if there is any way to affect its size.

    --Kenoli

  4. #4
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by kenoli View Post
    I was curious how the default thumbnail which is displayed before a post is submitted is created and if there is any way to affect its size.
    You haven't told us what kind of posting system are you working with? Squarespace? Wordpress? Blogger? Or something else?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    You haven't told us what kind of posting system are you working with? Squarespace? Wordpress? Blogger? Or something else?
    Just a simple html post. i.e.:

    <form name="selectAction" action="<?=$_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data" >
    <input type="file" />
    <input type="submit" name="submit" value="Upload Image" />
    </form>

    The post data is picked up by a php script.

    What I am interested in, however is the thumbnail that is shown in the browser after the user has selected a file and before he/she has submitted it by clicking on "Upload Image".

    --Kenoli

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,712
    Mentioned
    102 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by kenoli View Post
    What I am interested in, however is the thumbnail that is shown in the browser after the user has selected a file and before he/she has submitted it by clicking on "Upload Image".
    I don't see a thumbnail being generated before uploading in Google Chrome, Mozilla Firefox or Internet Explorer - just the name of the image file itself in the file field.
    This must be something specific to a certain type of web browser - which web browser are you seeing a thumbnail in?

    If anything is capable of being done to that thumbnail, keep in mind that it will only affect people using the particular type of web browser that shows a thumbnail before uploading.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Enthusiast
    Join Date
    Aug 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    I don't see a thumbnail being generated before uploading in Google Chrome, Mozilla Firefox or Internet Explorer - just the name of the image file itself in the file field.
    This must be something specific to a certain type of web browser - which web browser are you seeing a thumbnail in?

    If anything is capable of being done to that thumbnail, keep in mind that it will only affect people using the particular type of web browser that shows a thumbnail before uploading.
    Well, that kind of solves my problem. I have been previewing it in a preview engine that uses webkit. Thanks for the heads up that everyone doesn't use webkit.

    I've got another solution for my issue that should work in all browsers (though I will test it!), and I appreciate your taking the time to respond to my poorly researched question.

    --Kenoli


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
  •