Connecting to smb shares?

Hi all,

Lucee 5.3.4.80 running on a Centos 8 instance trying to figure out how to connect to smb shares. Coming from Windows/Coldfusion the following simple code was being used to get a directory file count.

<cfdirectory
        directory="//10.10.1.100/share"
        action="list"
        name="getRP"
        sort="name DESC">

<cfoutput>
        getRP.recordCount: #getRP.recordCount#
</cfoutput>

Obviously this does not work on linux/lucee since unc is a windows function. Can someone guide me on how to make this work with smb? I’m unable to find any documentation or examples.

Also I should note that I want to avoid setting up local mounts to the network shares.

there is some old functionality in Lucee which might work?

https://luceeserver.atlassian.net/browse/LDEV-2494

Thanks for the tip. For anyone else working with shares this is how I got it to work.

Lucee admin shows the Bundle jar “jcifs” as enabled however it’s comment out in /opt/lucee/tomcat/lucee-server/context/lucee-server.xml

To enable smb functions uncomment the following then restart lucee.

    <resource-provider
            scheme="smb"
            class="lucee.commons.io.res.type.smb.SMBResourceProvider"
            arguments=""/>

Now you can connect to shares using the following:

For network shares with username and password.
smb://user:pass@server.name/share

For open network shares (no user or pass).
smb://guest:@server.name/share

3 Likes