Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry how to filter the file extensions in the file upload type?

    hi all,
    how to filter the file extensions in the file upload type? i've used "accept" attribute of the input element as accept="image/jpeg,image/gif". but no use......
    i want to upload image files to the server. how to implement this?help me......

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,011
    Thanks
    2
    Thanked 312 Times in 304 Posts
    Just because a browser "supports" a tag, does not mean that it actually uses it. Here is a web page that indicates that current browsers support the "accept" tag, but don't do anything with it because they don't have to - http://www.webdevout.net/browser-support-html

    If you want to check file extensions, you can do this using javascript before the form uploads the file. Here is a link I found through searching the Internet - http://willmaster.com/blog/javascrip...xtensions.html
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    Jun 2007
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy value of the "file" should be cleared.how?

    thanx frnd,
    it is working. but i need, value of the file type should be cleared when user chooses wrong file(other than images)..


  •  

    Posting Permissions

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