• Post Reply 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

making documents available through website

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello, I am making a website. I want some documents (.doc or . ppt)to be available to everyone stored in my computer. How can i do it.. please help.thankyou in advance
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make them available via a web app and create links to them.
 
supriya lal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am new to web development.. where should i keep the documents and how should i link them to my webpage..thankyou
 
Greenhorn
Posts: 12
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are several ways of doing this,

1) You can make your files available through FTP, where your files sit on some FTP server and users can use FTP client to pull them.
2) You can host on a HTTP Server and users can use HTTP to get them.
3) Since you posted this in Servlets forum, I believe you may want to more than just providing files to users. If this is the case, one simple approach is to drop the files in webcontent folder ( not under WEB-INF)and you can provide links like http://<<server>>:<<port>>/<<root>>/<<file name>>

For eg, if you have a structure like below



then your link will be http://localhost:8080/SampleWeb/files/file.pdf

but with this approach, all the files outside WEB-INF are accessible to any one. That is they are public. You may have to restrict access explicitly.

But if you wish to drop them under WEB-INF, then they are not directly accessible and the approach is to implement file download servlet. There are several examples available. Look for Multi part file transfer servlet examples.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prakash Pantula wrote:Look for Multi part file transfer servlet examples.


Mulit-part forms are for file uploads; not downloads.
 
Prakash Pantula
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for correcting me Bear.

Supriya - There was a discussion on the same topic here
 
supriya lal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks prakash.. i will try to implement it
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic