There is a file manager in my application, where teachers can share files with other teachers. Files such as documents and images can be inserted into the learning course for students.

Once your shared file has been used by some other teacher in their course, what should happen if you want to delete your file?

  1. Show notification that the file is in use and allow to delete.
  2. Show notification that the file is in use and do not allow to delete.
  • 1
    What are the implications of deleting a file that has been shared? Hard to answer without knowing that.
    – user31143
    Commented Nov 7, 2016 at 10:32
  • @dan1111 Shared files can be inserted to e-learning courses and will no longer be available to students.
    – rpavl
    Commented Nov 7, 2016 at 10:50

7 Answers 7


Would you like to be interrupted while learning?

If someone is using the file it will not be a good user experience to immediately stop his work because someone has deleted it. Maybe a student is writing something and has made considerable progress. Or maybe she is reading.

Interrupting users will bring a lot of user frustration and loss of their work, specially when learning new material. This is why you should not allow deletion of a document when it's in use.

Provide alternatives

Why not allow the user to finish its work and then delete the file? You can also put a notification that the file will be deleted after its closed.


If there is going to be no real time collaboration or live editing features, then the file will be at use only at download time. Therefore, the answer remains the same:

Don't interrupt users when downloading a file, instead wait for the file to be downloaded and then delete it.

  • 1
    There is no real-time collaboration with the file as such. Files are simply inserted to the content as links, as well as images. The user will not be interrupted. File or image will disappear after page refresh, if deleted.
    – rpavl
    Commented Nov 8, 2016 at 9:44
  • 1
    Adding to this, I think it's fair to allow the uploader to delete the file as it may contain wrong information or it may be updated with a newer version. An alternative to deletion is the ability to archive it, thus hiding it from active view, while still retaining the ability to access previously available files. Commented Nov 8, 2016 at 13:00

No notification is required as it doesn't interrupt the user.

  • Assume that you have shared a document such as DOC, RTF, XSLX, or simple text file, PDF, PNG, JPG, GIF, etc.
  • The other person (teacher) clicks on the file. Clicking on the link or file opens the file by using (depends on the kind of implementation):

    • Browser (using PDF, MS Word plugins, etc.) - For instance Google Docs or Drive
    • Local apps (PDF reader or MS word, etc.)
    • Prompts the user to download the file in order to open
    • If an appropriate app is not found, the system will ask the user to select the default app to open the file
  • Since the files were opened in browsers (plugins) or in default local apps (which are installed on desktop), deleting the files by the owner will not interrupt the users and doesn't require a notification to be displayed

  • But, once the system gets refreshed (manual or automatic), the files which were deleted / invoked access levels by the owner will no longer be available or shown to the other person.

If the user opts for download or the file automatically gets opened by the local apps, the files will be available locally (default destination / temp folder).


First, if it's a learning material all those who have access to the file should have an access to download the file on their local machine. So, irrespective of whether the author deletes the file or not all others will have their own copy.

With that they can modify the edits and re-upload the file for other to see (If at all necessary to do so).

If you are only showing notification to the author, he/she will get frustrated with the notifs and will give up on deleting the file. These cases work well with a small working team of 10 people, but if you are a educational domain with over hundreds of associates - it will not be an appropriate choice.


What Deeksgit said is true, files that are already opened in the browser or on your local machine won't be affected by file deletion once they are opened.

What you actually need to do is to restrict the ways the student can access the files. I would only allow the users to viee the files in browser or download them.

If the files were downloaded, nothing to worry about. If they are viewed in browser you can have some controll over what happens next.

I would write a script that runs on window close:

  • First prevent default
  • Next check to see if the file was saved and if not
  • Check to see if the file was deleted and if it was:
  • alert ('the file was deleted by the owner, if you still need the info please save on local machine').
  • i would also add if file was replaced/modified
  • alert ('we've just uploaded a newer version of this file, would you like to refresh?')

I would also add an alert for the first closed file without saving but not deleted to inform that the owner can delete it at any given time and they should save it.


The case is a teacher Alice that has published some material and later on she wants to cease publishing it.
Other teachers, Bob and Cal, might have referenced the original material, if they found that the content fits their course.
On top of this, a number of students might be using the material, which means things like just now they are sleeping but tomorrow first thing in the morning they will continue using it.

Then Alice decides to stop publishing the original material.
Perhaps she had developed an online course and now the course is being taken down, or maybe she's replacing the original material with a newer version.

If Alice is taking down her course the course materials that are referenced by other courses (maybe by Alice herself) should stay there so those other courses, or the students, can still peruse it.
The material should vanish (archived) only when it is not referenced and after a while, like one year.

If Alice is replacing the material with something newer, then it should be handled as above and additionally the system should tell Bob and Cal that they are pointing to an outdated item giving them the opportunity to update.
The students should also be warned, upon opening the content, that they have the option to switch to the newer version.

Another case is if the material was found to be inappropriate, harmful, or whatever so that there is value in taking it immediately.
In this case it should be blocked and deleted immediately.
This is different from the other cases where the material is left in the server albeit dereferenced.


Maybe you should provide 'Status' field for each document

For example when student is working with particular document it has status 'In Use' and this document can't be deleted at this moment. Meanwhile, person that is working with this document at the moment is getting notification that this document will be deleted with some delay after using. But of course interrupting the progress is unacceptable.


Once your shared file has been used by some other teacher in their course, what should happen if you want to delete your file?

  1. Show notification that the file is in use and allow to delete.
  2. Show notification that the file is in use and do not allow to delete.

Given a choice, it would be better to get a notification. A notification would give them a chance to think whether they want to delete/replace/create-new-file depending on the type of content they are dealing with.

If the modified content is "images, art work", then you could go either way.

If the modified content is "Latest Syllabus for this Semister" OR "New Question Paper Pattern", then students better be reading it rather than spending time on obsolete content.

If the modified content is something like "How to balance Redox Reactions in Acid Base media, illustrated with 24 equations" OR "Nine steps in Calvin Cycle" OR "A guide to Nomenclature of Organic Compounds", then modifications would be too painful to follow. It would be nice to have a link to "old content".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.