Bookmark Topic Watch Topic
  • New Topic

I am facing problems in file uploading into my server location

 
Suresh Entropy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am facing problems in file uploading into my server location. The thing is, am testing locally upload by setting the file path it was working fine.But my development needs to be work in Production environment where i need to upload that file in respective server location(path). After this being done, i again need to convert that Client uploaded server location into a URL for previewing that Uploaded document by client in a JSP Page. Kindly help me in getting out of this nearly it taken most of my development time. Thanks in advance.

-- Suresh
 
J. Kevin Robbins
Bartender
Pie
Posts: 1801
28
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
Suresh Entropy wrote:I am facing problems in file uploading into my server location. The thing is, am testing locally upload by setting the file path it was working fine.But my development needs to be work in Production environment where i need to upload that file in respective server location(path).


I would store the upload destination path as a context param in the web.xml. Then your code can just reference that parameter and it doesn't matter if you are working locally or on a server. Changing the path now is just a setting in web.xml and you don't have to touch the code.

Suresh Entropy wrote:After this being done, i again need to convert that Client uploaded server location into a URL for previewing that Uploaded document by client in a JSP Page.


This should be a simple matter of assembling the pieces. You can get the context from the servlet container (${pageContext.request.contextPath}), you have the upload path as a context param, and you have the filename somewhere (I would probably save it as a session attribute prior to the upload). That should be everything you need to build a URL.

If you still have problems, post your code and show us exactly where you are having problems, what you expect the code to do, and what it's actually doing.

 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please dont post the same question multiple times, I am locking this one so that we can continue the discussion here .
 
    Bookmark Topic Watch Topic
  • New Topic