SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Oct 2002
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checking the size of an image before uploading

    I am not a major javascipt person, but rather PHP. However i need javascript to valid a form to see if the image that someone adds to a form is too large.

    Is there anyway of using javascript to do this. Ie chekc that if the image is beloe 200kb and if it is not then to popup an alert...

    Any ideas?

    kjc
    Eternity

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    You can't do that client-side. The best you can do with Javascript is get the local file path on the client machine (when it's populated in the FILE input). You'll have to do your checking server-side to do it properly.

  3. #3
    SitePoint Addict
    Join Date
    Oct 2002
    Posts
    229
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats a pain!

    Cheers anyway
    Eternity

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ::: certified wild guess :::


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
  •