Hi, i got the following situation:

When user clicks on some link, I'm entering a servlet in which I'm copying a file to a network drive, and than I want to open this file on the Client side, for example the file to be opened is a .pdf file.

I tried something but all i managed to do is to open the file on the server side, each time the user clicked on the link

p.s the important part is that the file is must be opened from the servlet (java code)

I do not know this will suite you but try simply redirecting to that file so that the PDF will directly open in the browser (if the client's browser supports it ) or it will ask the Client whether he wishes to download the file on his machine and open it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.