• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to send a file or data modified in server side to client

 
nira sri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to JSP and Servlets.
I have a web application that would update a particular file in Server side.
whenever a client accesses that particular web application i want to send that particular file or data that has been updated in the server side to the client.
Please help me in solving this issue.

Thanks in Advance,
Nira
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put it in a publicly accessible directory, and provide a link to it.

Alternatively, you can provide a link to a servlet that will then stream the contents of the file to the client. That way you can avoid keeping the file in a public directory.
 
nira sri
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply.
I am not clear on this.
can you please elaborate more on "how a servlet would stream the contents of the file to the client?"
any link for API's or examples?
and also how will the server knows which are the clients that are using the application concurrently?
is there any methods that are available?
any link to examples?

Thanks in Advance,
Nira
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you please elaborate more on "how a servlet would stream the contents of the file to the client"?

Have a look at the SimpleStream example in http://faq.javaranch.com/java/CodeBarnServlets

how will the server knows which are the clients that are using the application concurrently?

What do you mean by this? If the web app needs to know who is using it, then you need to implement some kind of user management and login mechanism.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic