Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Delete file from client system using Jsp / servlet

 
Munir Ahmed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Munir Ahmed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic