jquery - reads only file name not full path -


I am using a glassfish server. I have seen upload Apache file to solve it ... but I want to implement it in the Glassfish server.

image.html

  & lt; Form action = "" method = "post" encrypt = "multipart / form-data" & gt; Choose a file: & lt; Input type = "file" name = "first" id = "first" /> & Lt; Br / & gt; & Lt; Input type = "button" name = "button" value = "upload" id = "button" /> & Lt; P id = "test" & gt; & Lt; / P & gt; & Lt; Img src = 'unknown.' Id = "profile_img" height = "200px" width = "150px" /> & Lt; / Form & gt;   

test.js

  $ (document) .ready (function () {var filepath = $ ("# first"); $ ('# Click the button.) ($ ("(" "" ")" $ ("#"). Html (msg). FadeIn ("fast");}});});});   

imageservlet.java

  string user = request.getParameter ("user"); Out.print (user);   

The output file name is not a full path.

Browsers handle it differently All browsers will not let you access the full path name (which is a security approach Makes sense right from).

Comments