SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    js validation for image ??

    i am trying to make the javascript validation for images..
    For example i tried to upload the file "c:\folder\file.exe"
    It should check the extension , if the extension is not image type
    should give alert..

    what i want?
    1> i want to know if there is any function in javascript
    that reads the extension of full path like "c:\folder\file.exe"
    2> file size
    Thanks in advance to all of you !!

  2. #2
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1)
    Code:
    var filename = document.getElementById("fileInputID").value;
    var ext = filename.substring(filename.lastIndexOf('.') );
    2) not possible

  3. #3
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pardon again..
    is it possible to show the upload preview while uploading with javascript ?

    If Yes i am eagerous to know the solution..
    Thank you !!


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
  •