Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 07-09-2019, 05:07 AM   #1
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Save file in Restricted folder

Hello,

Right i have set the form with save *.pdf in folder by IDs. All works as it expected.

What I'm thinking right now and cant find any related data. Is it possible to save PDFs with same code in folder where folder has just to "Write" permission?

Some users will be not allow to open the folder but allow to save the PDFs.

Thanks in advance

Juolupuki is offline   Reply With Quote
Old 07-09-2019, 05:31 AM   #2
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,095
Thanks: 81
Thanked 1,601 Times in 1,485 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: Save file in Restricted folder

Windows file permissions can get quite complex. In order to save the files they will have to have low-level permission CREATE FILES/WRITE DATA to the folder itself. Also, if I recall correctly, WRITE ATTRIBUTES on the file being created. To determine whether you have any file conflicts, that means READ DATA on the folder and READ ATTRIBUTES on the created file have to be in the mix.

What happens if the user tries to update something and thus tries to save the file a second time by the user ID? You would get naming duplicates which would be a really big problem for your program to resolve if the folder is restricted. You would either have to trap an error or be able to know of this conflict ahead of time (using a method to read the directory).

Now you MIGHT consider that you could declare the folder to be "hidden" so that the users won't immediately know it is there. However, even a user with limited knowledge of Windows would be able to find how to show hidden files. This would be a form of "security through obscurity" and is generally doomed to failure (in the sense of being a secure method).

If you have users who cannot be trusted to leave things alone, your problem isn't in your code, it is in the users' heads and must be solved by reprogramming THEM. I.e. via training or warnings or threats (if necessary).
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
The Following User Says Thank You to The_Doc_Man For This Useful Post:
Juolupuki (07-10-2019)
Old 07-09-2019, 06:03 AM   #3
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 11,027
Thanks: 40
Thanked 3,578 Times in 3,456 Posts
CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light CJ_London is a glorious beacon of light
Re: Save file in Restricted folder

one little trick to discourage users from browsing to your folder to open files

create a folder "A"
in this folder create another folder "B"

now in windows security permissions deny access to all users to folder "A" (but not subfolders)

in your app provide a path direct to folder "B"

Obviously if users get to know the full path they can just type it into windows explorer so they can then open the files, so your job is to make sure the path is never visible in your app.

It's a long time since I did it but to deny access if I recall correctly you need to put all users in a group, then edit the folder properties>security to deny access

__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
The Following User Says Thank You to CJ_London For This Useful Post:
Juolupuki (07-10-2019)
Old 07-16-2019, 01:52 AM   #4
Juolupuki
Newly Registered User
 
Join Date: Jan 2018
Posts: 31
Thanks: 23
Thanked 0 Times in 0 Posts
Juolupuki is on a distinguished road
Re: Save file in Restricted folder

Hi,

Thanks for responds. The bought suggestions made me thinking.

What i will do is, ill set folder for normal users permissions just to write and files will be saved in temp folder. For users who needs to read the files will be moved from temp in to other folders as soon they will login, because just they have access to these folders.


I have tested and kinda works.

Juolupuki is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Save As VBA UNC with Multi-Level folder creation level for automation Rx_ Excel 2 03-29-2017 09:27 AM
How to save file from attachment field to external folder behnam Modules & VBA 1 09-05-2014 11:39 AM
Save access report as PDF and save to folder jsbarroso Modules & VBA 4 01-10-2014 03:37 PM
print to word and save in folder with the ID nr and product code also the file name megatronixs Macros 0 09-18-2013 11:16 PM
open save file dialog and select the file from a text box and save to the place hfs General 1 08-09-2013 01:37 AM




All times are GMT -8. The time now is 05:55 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World