Mango



Thread: com/asfusion/fileexplorer/MainFileExplorer.cfc

Created on: 03/18/11 02:06 AM

New topic Reply    Page: 1  

Replies: 6
akitogo


akitogo's Gravatar
Joined: 03/18/11
Posts: 4

03/18/11 2:06 AM

Hi,

our assets are on a shared network path, the directory is a virutal directory on the web server.

If I'm clicking on the green preview download button the redirect leadsa to a non existing path.

We are still on MB 1.5

After doing some debugging I found this

   
      
      
      
      
   
      
      
          
          
          
       



This looks wrong to me:
cfif findnocase("/",assetsInfo.path) NEQ 1 OR findnocase("http",assetsInfo.path) NEQ 1

It should be (replace OR with AND):
cfif findnocase("/",assetsInfo.path) NEQ 1 AND findnocase("http",assetsInfo.path) NEQ 1

What do you think?
Link | Top | Bottom
akitogo


akitogo's Gravatar
Joined: 03/18/11
Posts: 4

03/18/11 2:08 AM

ups code is gone, trying again:

   cffunction name="init" output="false" returntype="any"
      !--- making a dependency on Mango here, but at least I can remove the
      reference in application.cfc ---
   cfset var blogManager = application.blogFacade.getMango() /
      cfset var blog = blogManager.getBlog() /
      cfset var assetsInfo = blog.getSetting('assets') />
   
    cfset variables.settings.rootDirectory = assetsInfo.directory /
      cfif findnocase("/",assetsInfo.path) NEQ 1 OR findnocase("http",assetsInfo.path) NEQ 1
          cfset variables.settings.rootUrl = blog.getBasePath() & assetsInfo.path /
       cfelse   
          cfset variables.settings.rootUrl = assetsInfo.path /
       /cfif
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1523

03/30/11 7:37 PM

The purpose of that check is to allow using a specific path in a different domain such as "assets.myDomain.com" or off the root somewhere. That covers the other two cases besides the default location of assets.

If your assets are in a network drive, they still need to be available via the web server in some path (ie: virtual directory or another domain). How would you normally browse those files in the drive?
Link | Top | Bottom
akitogo


akitogo's Gravatar
Joined: 03/18/11
Posts: 4

03/31/11 4:06 AM

the path on web server is:
www.mydomain.com\mango

coldfusion can access it by:
\\remoteFileserver\imagedir\mango\
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1523

03/31/11 10:09 AM

Just to clarify, would I find the image "myPhoto.jpg" in \\remoteFileServer\imagedir\mango\myphoto.jpg" if I browse http://www.mydomain.com/mango/myphoto.jpg?
Link | Top | Bottom
akitogo


akitogo's Gravatar
Joined: 03/18/11
Posts: 4

03/31/11 11:43 PM

yes
Link | Top | Bottom
Laura

Wizard
Laura's Gravatar
Joined: 01/29/05
Posts: 1523

04/01/11 10:19 AM

Ok, so then open the database, table setting, look for entry "system/assets" and in the value field enter:
"http://www.mydomain.com/mango/";

or if they are in the same domain, you can enter the absolute path:
"/mango/"
Link | Top | Bottom

New Post

Please login to post a response.