#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    0
    Rep Power
    0

    getContentType()


    I have a jsp page that uploads a file and a number of text fields. What I want to do is get the type of file it is (eg .doc/.jpeg) and save this as a string in my database. Does anyone know how to do this?
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
    It seems difficult because the file comes up encoded as multipart, the easy ways could be:
    - use filename: *.pdf -> x-application/pdf
    - use client side javascript/applet

    Wait, maybe this servlet http://java.isavvix.com/codeexchange...tail.jsp?id=15
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    0
    Rep Power
    0
    Anyone know how to do this in jsp? Please

IMN logo majestic logo threadwatch logo seochat tools logo