• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Delete file from client system using Jsp / servlet

 
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
 
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...

 
Marshal
Posts: 67418
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
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.
 
You may have just won ten million dollars! Or, maybe a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic