Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I am facing problems in file uploading into my server location

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Are you okay? You look a little big. Maybe this tiny ad will help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic