
Test_file = "/content/drive/MyDrive/test.txt" This will open a new Google App script.Ĭonst = fileUrl.split('/').filter((e) => /).execute() Create a new tab in your browser and go to the URL.Set the permissions of the link to edit, otherwise, the script can't lock the file. Right-click on the file, click on the "get link" option and copy the link that you will see in the pop-up menu. Get the shareable link for the file you want to lock.Here are the steps you need to take (Credit to )


No one can edit the file after locking, but unlocking is relatively straight forward.

While it's as much a mea culpa as you'll get from the internet giant, getting randomly locked out of your own documents was a wake-up call for some users who realized how much they depended on Google to access their cloud-based files - access that can be revoked or shut off by bugs or intention.You can lock your files, but unfortunately that is not a very simple action. In a blog post, Google stated that its automatic security detects and prevents access to files that might contain viruses, malware or 'other abusive content.' The bug caused Docs and Drive to misinterpret the signals from these systems, which resulted in erroneously marking particular files as violating TOS. The company mentioned automatic digital security mechanisms that protect users from malware and phishing in their Docs and Drive systems - and it seems those were falsely triggered by this code flaw. On Halloween, some Google Docs users got a spooky surprise when they were locked out of their own documents for 'violating Google's terms of service.' The internet titan sent out a fix and a statement assuring Engadget that the lock-out was the result of faulty code that erroneously marked some documents as abusive.
