GeeCON Prague 2014*
The moose likes JSP and the fly likes Delete file from client system using Jsp / servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Delete file from client system using Jsp / servlet" Watch "Delete file from client system using Jsp / servlet" New topic
Author

Delete file from client system using Jsp / servlet

Munir Ahmed
Greenhorn

Joined: Jan 23, 2009
Posts: 2
Hi....

I m facing a problem ,

I want the user to upload a file from his system , once he selects the particular file the file must be uploaded and the file in client system should get deleted.

I need it urgently , how could i achieve this...

Thanks in advance
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Munir Ahmed wrote:Hi....

I m facing a problem ,

I want the user to upload a file from his system , once he selects the particular file the file must be uploaded and the file in client system should get deleted.

I need it urgently , how could i achieve this...

Thanks in advance


Do you mean that the server should delete a file on the client. That would be very insecure as then, the server can delete any file on its client. I think you should consider writing client side code for the client to upload the file to the server and then delete it.


Thanks and Regards
Munir Ahmed
Greenhorn

Joined: Jan 23, 2009
Posts: 2
Satya Maheshwari wrote:
Munir Ahmed wrote:Hi....

I m facing a problem ,

I want the user to upload a file from his system , once he selects the particular file the file must be uploaded and the file in client system should get deleted.

I need it urgently , how could i achieve this...

Thanks in advance


Do you mean that the server should delete a file on the client. That would be very insecure as then, the server can delete any file on its client. I think you should consider writing client side code for the client to upload the file to the server and then delete it.



Thanks for your kind reply

how to write the client side code to upload and delete the file...
the main thing i need is after uploading the file to the server the file on the client machine should get deleted...
since i will supply the file again to the client...

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61318
    
  66

Cannot be done. Neither of the client-side JavaScript or the server-side Java has the ability to affect the client file system. Thank goodness!

Your only option may be a signed applet.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
how to write the client side code to upload and delete the file...
the main thing i need is after uploading the file to the server the file on the client machine should get deleted...
since i will supply the file again to the client...

Um.. I think I got the terminology wrong. By client side code, I meant writing a java application on the client which does this.
Tamas Jano
Ranch Hand

Joined: Feb 21, 2007
Posts: 55
You could embed a nice little applet there which MUST be signed and could use it for upload.

Remember that the user still has to accept to trust the applet and you can't touch anything without his/her consent. After accepting it the machine is all yours but it is still constrained that the user has the java plugin (even to accept your signature).

Or you can look into Java Web Start (JNLP) but that takes it out of the browser.

Hope it helps.
 
GeeCON Prague 2014
 
subject: Delete file from client system using Jsp / servlet