• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to restrict user to delete/modify the file when uload is in progress

 
P Lavti
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to restrict the user from deleting or modifying a file, when the file upload is in progress. If user tries to delete/modify the file, a msg should appear "File is in use by another program".

Please let me know how can i acquire such a lock on the file, File is in client's m/c and user is trying to uplaod the file using IE from client m/c to server.

Thanks in Advance
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
File is in client's m/c


What's an "m/c"?

In any case, neither the server-side or client-side code for your web application has any ability to affect the file system of the client machine. So, no, you can't lock the file.
[ October 23, 2007: Message edited by: Bear Bibeault ]
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Hijack removed]

Tarun Yadav,
Please enter your question in a separate thread so it doesn't inadvertently turn this one away from the original poster's question.

Thanks,
-Ben
[ October 23, 2007: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this is posted in the Servlets forum, it's safe to assume that a multipart request is being used to upload the file. And as I said, no access to the client file system is possible.

If this is a hard requirement that must be met, a different means of file upload will have to be found (rich client, signed applet, etc).
 
P Lavti
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
m/c stands for machine. Sorry for the confusion

I m using Apache file upload utility to upload the file.

I have observed in yahoo mail, when a attachment upload is in progress, if user tries to delete the file, a message is displayed "File is in use by another program". I need to develop similar behavior for my project. Any other utility API's can i use to achieve the same?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by P Lavti:
m/c stands for machine
Please use real words when posting to the forums. Abbreviations such as "m/c" in place of "machine" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by P Lavti:
I have observed in yahoo mail, when a attachment upload is in progress, if user tries to delete the file, a message is displayed "File is in use by another program".

That is a function of the operating and file systems, not something that you can effect from your web application.
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tarun Yadav:
[Hijack removed]

Tarun Yadav,
Please enter your question in a separate thread so it doesn't inadvertently turn this one away from the original poster's question.

Thanks,
-Ben

[ October 23, 2007: Message edited by: Ben Souther ]


Sorry Ben, I figured if someone were to explain how the upload happens that would help resolve the OPs concerns.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!