Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Secure docx file in a folder

Status
Not open for further replies.

eyeshield21

Programmer
Aug 13, 2014
62
PH
after i copied docx file into a specific folder..
i discovered that the files on that folder can be mannualy modified or deleted..
so what is the best and easiest to protect files on that folder.
thnx
 
i discovered that the files on that folder can be mannualy modified or deleted

Surely that's the case with any file in any folder. Given that the user has ultimate control over their file system, they must always be feee to modify or delete files at will.

However, you can make it slightly harder for a user to modify or delete a file by marking the file as read-only. That's easy to do programmatically, but it's something that a knowledgeable user can easily get round.

Why exactly do you want to "protect" the file? What are you protecting it from?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
protecting from unauthorize person..
anyone can delete or modify that file which could be a problem
to the system and the administrator.

in addition, that files can be modified or deleted by
the administrator only that is why that files are not free
to modify by user only
 
Then make the directory only available to authorized users of your system... otherwise, how would they get to it?
If you're worried someone logs in and takes over their PC, then that's not a VFP issue... it's a user account administration and access control policy issue.


Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
You can only block out users from file access by making it a secrert where those files are. As your app runs with the Windows account of the user, he needs access and modification permissions anyway, unless your application impersonates another users.

There are such Windows API cals, that would alow that, but it has it's flaws and riscs, once your application runs with another account users don' eetheir dcuemnts folder in a GetFile() dialog, for example, also they can get at the docx from there, if they just find out.

In the end your file security can only be better or differing from the OS, if you do encryption of files only your application decrypts. But even with sich options first think about how to solve your permission design in normal ways of folder/file permissions. If you need fina granular permission control you better have a system where people need to check out and in files, eg Sharepoint or even some source control management. And documents themselves can't contain parts a user only should be able to read and parts a user can edit. You never mentioned such a demand, but if you had it, it would be reason to even rethink document composition.

Bye, Olaf.
 
The only way to lock users out of files used by your application is to lock them out of your application entirely.

You can, in some cases, mitigate non-application use of files by storing those files inside a memo field used solely for the purpose of storing files. The downside of this approach is that if that dbf/fpt ever corrupts you lose EVERY DOCUMENT.

This is actually a user education and employment policy issue. Inform users that accessing those documents outside the application is cause for termination. You will not have to enforce that policy more than once.
 
The other issue with storing files that way is you VERY quickly hit the 2GB limit on a table. And that becomes very annoying as well.
The other alternative is to move away from VFP tables to SQL, though I've not done this myself, others here have mentioned it on many occasions.

Best Regards,
Scott
ATS, CDCE, CTIA, CTDC

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top