Results 1 to 1 of 1
Thread: Filepath Issue
- 02-28-2009, 04:08 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 5
- Rep Power
- 0
Filepath Issue
Hi,
I am developing a Java Servlet that gives the user the ability to browse their machine for a specific file and submits its location
Java Code:public void doGet (HttpServletRequest req,HttpServletResponse res) throws ServletException, IOException { PrintWriter out = res.getWriter(); ........ out.println("<br/><br/><input type="file" value="Browse" name="urlbar\">"); out.println("<br/><br/><input type=\"submit\" value=\"Register Document\" name=\"submit\"></font>"); .... }
At the moment the problem is that once the "submit" button has been pressed, only the file name is returned and not its entire path.
I have tried using the getAbsolutePath() method of the File class but it returns that the file is located in the bin folder of the servlet container (which is not the case!). Can anyone help?Java Code:protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { PrintWriter out = res.getWriter(); String url = req.getParameter("urlbar"); System.out.println(url); .... }
(if you need more info, let me know)
Thanks.
Similar Threads
-
File fp = new File(filePath);fp.exists() does not yeild proper result
By ganeshp in forum Advanced JavaReplies: 2Last Post: 04-07-2009, 06:25 AM -
Issue jsp with FireFox
By dimuthunsj in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 10-10-2008, 11:08 AM -
Threading issue
By Eku in forum New To JavaReplies: 2Last Post: 09-18-2008, 10:47 AM -
NullPointerException issue
By fritz1474 in forum AWT / SwingReplies: 2Last Post: 09-03-2008, 05:21 PM -
Issue
By chaitu444 in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks