I have started using the Store Pictures in the FileSystem functionality rather than the DB and I am very curious where the best place is to store them and also naming conventions for the Pictures from a Best Practice perspective.
As I see it.....I think there is no argument from the outset that it is better to store them in the filesystem rather than the DB purely from the point of avoiding DB bloat. However, the fact that it was supposed to also avoid the the image remnants accumulating in the webapps/AwareIM folder was attractive.
BUT, as I understand it....
Let's call the webapps/AwareIM Folder... "The Wall"
North of The Wall is off limits....a mystery so to speak to the outside world. The is everywhere between C:\ ..... and webapps\AwareIM
South of The Wall is Westeros..... fully explorable for those Brave enough.
Hence, if I save a Picture South of The Wall then it can potentially be Viewed and Download by ANYBODY in the Seven Kingdoms.
For example.... save a photo called MyPhoto.jpg to C:\AwareIM\Tomcat\webapps\AwareIM\Custom\CSS\mybusinessspace\images\MyPhoto.jpg
Now enter the URL in a Browser https://mydomain/AwareIM/CustomCSS/mybu ... yPhoto.jpg and your image will display in the Browser.
So, this is fine for Aware because it no longer needs take a copy of the image from the BD and place it South of The Wall to display it in the Browser. It is immediately available and no image remnants are created.
To my mind this creates a dilemma depending on the sensitivity of you images/pictures/photos.
For example:
Sensitive Images
Passport Images
Personnel Images
License and Permit Images
Non Sensitive Images
All images that are of "things" or "places" rather than people.
So, am I right in saying that ALL Sensitive Images should be saved North of The Wall and ALL Non Sensitive Images can be saved South of The Wall?
If that is correct, then, for Images North of the Wall... you retain the advantage of getting them out of the DB but lose the advantage of zero remnants South of The Wall being created.
IMAGE FILE NAMING CONVENTIONS:
Which brings me to the next point..... FileSystem Paths.
This is applicable for both North and South of the Wall...
I upload and Image to the app...
When first created the RULE is ...
If Employee.PictureFull WAS CHANGED Then
Employee.PicturePath=SystemSettings.PathIMAGESSecure+Employee.ID+FILE_NAME(Employee.PictureFull)+'.'+FILE_EXTENSION(Employee.PictureFull)
This puts the image in the correct location and names it correctly....
For example.....it can be seen in the folder as 1298956me.jpg
and the FilePath = C:\MYDOCUMENTS\MYBS\SECUREIMAGES\1298956me.jpg
BUT, now if I EDIT the Form that has that image on it again.... AND DO NOT CHANGE A THING... JUST CLICK SAVE...
Aware executes the Rule AGAIN (EVEN THOUGH NOTHING WAS CHANGED) and creates another file called
1298956
And the FilePath = C:\MYDOCUMENTS\MYBS\SECUREIMAGES\1298956.
Sorry for this being so long by would be very interested to get some feedback and would love to establish a "FileSystem Images Best Practice" document that can be shared across the entire 7 Kingdoms.
Cheers,
Mark
Pictures FileSystem - Best Practice Discussion?
-
- Posts: 2403
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Pictures FileSystem - Best Practice Discussion?
Last edited by customaware on Sat Sep 15, 2018 11:36 pm, edited 1 time in total.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: Pictures FileSystem - Best Practice Discussion?
Hi Mark,
Did you get the way to solve this?
Did you get the way to solve this?
AwareIM is not able to detect the actual change and it always runs the rule.BUT, now if I EDIT the Form that has that image on it again.... AND DO NOT CHANGE A THING... JUST CLICK SAVE...
Aware executes the Rule AGAIN (EVEN THOUGH NOTHING WAS CHANGED) and creates another file called
1298956
And the FilePath = C:\MYDOCUMENTS\MYBS\SECUREIMAGES\1298956
From,
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
-
- Posts: 2403
- Joined: Mon Jul 02, 2012 12:24 am
- Location: Ulaanbaatar, Mongolia
Re: Pictures FileSystem - Best Practice Discussion?
Not really Himanshu.
I intend to try the implementation that Robin presented at the Espinho Conference which looks to me like the best all round solution.
I intend to try the implementation that Robin presented at the Espinho Conference which looks to me like the best all round solution.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Re: Pictures FileSystem - Best Practice Discussion?
Thanks, Mark for recalling... will look that presentation again.
From,
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Re: Pictures FileSystem - Best Practice Discussion?
Would you care to elaborate a bit on the concept please, I would be interested to understand a bit more about alternatives. I use document attributes in the file system extensively, sounds like the picture to file system attribute works differentlyI intend to try the implementation that Robin presented at the Espinho Conference which looks to me like the best all round solution.
Re: Pictures FileSystem - Best Practice Discussion?
I just had this happen to me. Noticed that Rule was firing when it shouldn't.
Rule: If Photos.ThePic WAS CHANGED then ....
and even though its NOT being changed, its recalculating.
Thought I read long time ago to check if FILE_SIZE had changed, but that means I'd have to store it and have not needed to until this point.
Rule: If Photos.ThePic WAS CHANGED then ....
and even though its NOT being changed, its recalculating.
Thought I read long time ago to check if FILE_SIZE had changed, but that means I'd have to store it and have not needed to until this point.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Pictures FileSystem - Best Practice Discussion?
I confirmed with the above statement.Jaymer wrote:I just had this happen to me. Noticed that Rule was firing when it shouldn't.
Rule: If Photos.ThePic WAS CHANGED then ....
and even though its NOT being changed, its recalculating.
I had spent a lot of time just fix the issue on certain use case ... when you have to make sure you do not create multiple copies of files when they change...or not even changed.
From,
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Himanshu Jain
AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL