"Relative Path" issues when storing images via FILE SYSTEM

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

"Relative Path" issues when storing images via FILE SYSTEM

Post by BenHayat »

I'm trying to use the new Image storing in the file system

I have created a text attribute to hold the path for the image. This path is under \Tomcat\webapps
and I put \TM_Assets\ABC.jpg for my patch and file name.
I also have another attribute called ProfileImage, as picture and FileSytem storage and I have it connected to above attribute.

When I run the program, I get a Select File button. I click on it to pick an image from my hard disk, I get error "The system can not find The file path specified".
The documentation doesn't provide any info how this path should be set.

I'm sure there people who use Document in file system.
Thanks!
Last edited by BenHayat on Sun Dec 02, 2018 11:01 am, edited 4 times in total.
bondicoffee
Posts: 130
Joined: Tue Dec 03, 2013 10:19 pm

Re: Need help with Setting File System path for images

Post by bondicoffee »

Hi Ben,

We are running our apps with a similar configuration. Can you try updating path in SystemSettings attribute value to "../Tomcat/webapps/AwareIM/Custom/Images/<YOUR_APP_NAME>/"
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Need help with Setting File System path for images

Post by BenHayat »

bondicoffee wrote:Hi Ben,

We are running our apps with a similar configuration. Can you try updating path in SystemSettings attribute value to "../Tomcat/webapps/AwareIM/Custom/Images/<YOUR_APP_NAME>/"
Thanks!!!

The two dots in front of /Tomcat solved the problem. Thank you!

Right now I m in discussion with support on another related issue with Image FILE SYSTEM
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by Jaymer »

All you need is this:

Custom/Images/<YOUR_APP_NAME>/

Your root directory is already under Tomcat/webapps + your BSV name

When you get an "image not found" error, which is most likely due to a Path issue, easiest thing to do is to go hack the URL and try to find your image. And thats super easy to do by INSPECTing the HTML and modifying the path in the source code.

WRONG
I'm editing this because I can't believe this works this way.
You REALLY DO have to have it the way Ben said above... but it makes no sense.
I'm trying to test for existence of a Directory and create it if it doesn't exist.
Sure enough, keeps failing until you add the "two dots" in front of /Tomcat

crazy
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
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by Jaymer »

dammit
i'm on 8.1 and this must be the problem thats messed with me for over an hour...
and makes the above issue weird.

from a recent changelog:
4. Relative paths didn't work when a document was saved in a file system

Been pulling my hair out
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
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by BenHayat »

Jaymer wrote:
from a recent changelog:
4. Relative paths didn't work when a document was saved in a file system

Been pulling my hair out
I found this problem and spent the whole Sunday working with Vlad to pinpoint it to "Relative" path. As soon as I told him it's the relative path problem, the light went off and he solved it
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by Jaymer »

He "solved" it?

The "two dots" didn't solve it for me.
Is the fix in the new build the solution?
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
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by BenHayat »

Jaymer wrote:He "solved" it?

The "two dots" didn't solve it for me.
Is the fix in the new build the solution?
Well, I have decided to go with "Absolute" path for some other reasons.
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by Jaymer »

All I was really trying to do was to use the "new" feature so AIM doesn't have to duplicate the image because its under Tomcat already. Hadn't tried that yet. And all I got for my good intentions was a wasted 3 hours :)
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
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by BenHayat »

Jaymer wrote:All I was really trying to do was to use the "new" feature so AIM doesn't have to duplicate the image because its under Tomcat already. Hadn't tried that yet. And all I got for my good intentions was a wasted 3 hours :)
Please report it to Support that "Relative" path still duplicates images under AwareIM folder. That was what I had discovered. By the time Support told me it was fixed, I had already adopted to "Absolute" path that was working, so I didn't really check if the update really fixed it or not.

If you see images being created (imgxxxxx.jpg) under AwareIM, that means the problem is still there.
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: [SOLVED]Need help with Setting File System path for imag

Post by BenHayat »

Jaymer wrote:All I was really trying to do was to use the "new" feature so AIM doesn't have to duplicate the image because its under Tomcat already. Hadn't tried that yet. And all I got for my good intentions was a wasted 3 hours :)
Jaymer, just tested the new fix, and the problem is still there, I'm sending support a BSV to show the problem still exists.
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: "Relative Path" issues when storing images via FILE SYST

Post by Jaymer »

Ben
my problem had nothing to do with the files still being copied under Tomcat, if thats what you're referring to as "still there".

my problem is that Aware was messing up the Path.
It appears that when you have a relative path, Aware, AT RUNTIME, is taking the path and altering that string to prefix it with your URL... but its messing it up.

In my case, one time I had this as the path in the database:
'../Tomcat/webapps/AwareIM/WebEntryPics/AssignImage.png'
and AT RUNTIME, the image would display as a broken link, and when inspecting it, that path showed as
'Pics/AssignImage.png'
I'm thinking "what the hell"? so I physically change the database record to a lowercase P and web page now showed
'pics/AssignImage.png'

After more fiddling around, I come to realize that its stripping what I have in the database off the front of that string - this is the new Aware Attribute that is supposed to hold the "value of the path in the file system". It doesn't use exactly what you have, but attempts (in an INCORRECT way) to concatenate the current URL and that path.
But since it screws it up, the image link is broke.
Also weird, is that in my case, it didn't even do it on a "/", but hacked into my Directory "WebEntryPics" and left only the "Pics"

jaymer...
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
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: "Relative Path" issues when storing images via FILE SYST

Post by BenHayat »

Jaymer wrote:Ben
my problem had nothing to do with the files still being copied under Tomcat, if thats what you're referring to as "still there".

my problem is that Aware was messing up the Path.
It appears that when you have a relative path, Aware, AT RUNTIME, is taking the path and altering that string to prefix it with your URL... but its messing it up.

In my case, one time I had this as the path in the database:
'../Tomcat/webapps/AwareIM/WebEntryPics/AssignImage.png'
and AT RUNTIME, the image would display as a broken link, and when inspecting it, that path showed as
'Pics/AssignImage.png'
I'm thinking "what the hell"? so I physically change the database record to a lowercase P and web page now showed
'pics/AssignImage.png'

After more fiddling around, I come to realize that its stripping what I have in the database off the front of that string - this is the new Aware Attribute that is supposed to hold the "value of the path in the file system". It doesn't use exactly what you have, but attempts (in an INCORRECT way) to concatenate the current URL and that path.
But since it screws it up, the image link is broke.
Also weird, is that in my case, it didn't even do it on a "/", but hacked into my Directory "WebEntryPics" and left only the "Pics"

jaymer...
Yes, that is ANOTHER problem I had reported.
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: "Relative Path" issues when storing images via FILE SYST

Post by Jaymer »

do you think this is fixed yet in 8.2? or is it too soon?
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
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: "Relative Path" issues when storing images via FILE SYST

Post by BenHayat »

Jaymer wrote:do you think this is fixed yet in 8.2? or is it too soon?
No the latest update was supposed to fix that and it did not.

Watch carefully, how the full path from the top box become truncated in the "Select Files name".

Image
Post Reply