320
Views
16
Comments
Solved
[Shared Folder] Got an example of how to use the "List File"
Question
shared-folder
Service icon
Forge asset by Leonardo Fernandes

Hi! I'm new to outsystems. I'm trying to figure out what values does the procedure is expecting. 

  • Hostname: is it the domain name?
  • Authntication:No clue whatsoever
  • Share: Is it the name of the folder?
  • Folder path: UNC?

If you have an example it will be greatly appreciated. 


Should it be:


2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

For anyone having difficulties on using the extension, this is to be used to access windows shared folders. You can usually access a windows shared folder by entering "\\server\share" in Windows Explorer, and sometimes you are asked for credentials. The path in the format "\\server\share\path\to\folder\file.txt" is called a UNC path, and it contains a hostname ("server"), a share name ("share") and a path ("path\to\folder\file.txt").

To use the extension, add dependencies to the SharpCifs extension.


  • Hostname: this is the hostname of the server that is hosting the shared folder. It corresponds to "server" in the "\\server\share" path.
  • Authentication: the username and password that should be used to connect to the shared folder. This is the same information you would type in if you were asked for authentication. If you're not asked for authentication, then the server is accepting your own windows credentials.
  • Share: the name of the share in the server. It corresponds to "share" in the "\\server\share" path.
  • Folder path: a path to a folder inside of the share. For example in "\\server\share\path\to\folder", the folder path would be "path\to\folder".
UserImage.jpg
Ingo Montarroyos

Wouldn't it be a good idea to add this to the documentation?

UserImage.jpg
Jyotsna Patil

Hello Leonardo,

I am trying to write binary data to network path but it fails with error : "Invalid URI :  Hostname could not be parsed."

Can you please help me out with this. I am trying to write data to network file path e.g.  "\\abc.xyz.com\Automation\OutSystems". Not sure why this error is thrown. Below is the parameter passed:

Domain: "\\abc.xyz.com"

HostName: "\\abc.xyz.com"

Share :  "Automation"

FilePath : "OutSystems\"+FileName

2023-11-10 11-46-42
Diogo Barbosa

Hostname doesn't need the slashes "\\", neither the domain... try "acb.xyz.com" on both.

UserImage.jpg
Jyotsna Patil

I also tried this but it throws different error : Failed to connect to server

2024-01-16 23-21-55
Chris Palka

Same issue. I've tried every single iteration. Which leads me to believe this is a networking issue. Even though the parsing of the URI seems to be whacky, duplicating "/".

2018-09-27 18-20-33
Swatantra Kumar
Champion

Hi Alan,

Since the Shared folder is implementation of CIFS, I believe the parameters should expect below values.

  • Hostname: host_name.organization.company.tld
  • Authntication:User-level authentication, or Share-level authentication 
  • Share: the name of the directory
  • Folder path: path of the share directory on the hostname

Regards,

Swatantra

2018-09-27 18-20-33
Swatantra Kumar
Champion

Alan Marquez wrote:

HI Swatantra , Thanks for the reply> Still have some questions maybe you can help.

1. Does CIFS means cloud base implementation?

Regards,

Alan


CIFS stands for Common Internet File System. It is a protocol for the network filesystem.  


UserImage.jpg
Prolacto 0

Hi

Can you make an example?

Regards,

Michael

UserImage.jpg
Larry Tay

May i know how to use this ?   We publish onto Integration Studio but in Service Studio-> add dependency ,  we cannot see any service components on shared folders.

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

For anyone having difficulties on using the extension, this is to be used to access windows shared folders. You can usually access a windows shared folder by entering "\\server\share" in Windows Explorer, and sometimes you are asked for credentials. The path in the format "\\server\share\path\to\folder\file.txt" is called a UNC path, and it contains a hostname ("server"), a share name ("share") and a path ("path\to\folder\file.txt").

To use the extension, add dependencies to the SharpCifs extension.


  • Hostname: this is the hostname of the server that is hosting the shared folder. It corresponds to "server" in the "\\server\share" path.
  • Authentication: the username and password that should be used to connect to the shared folder. This is the same information you would type in if you were asked for authentication. If you're not asked for authentication, then the server is accepting your own windows credentials.
  • Share: the name of the share in the server. It corresponds to "share" in the "\\server\share" path.
  • Folder path: a path to a folder inside of the share. For example in "\\server\share\path\to\folder", the folder path would be "path\to\folder".
UserImage.jpg
Ingo Montarroyos

Wouldn't it be a good idea to add this to the documentation?

UserImage.jpg
Jyotsna Patil

Hello Leonardo,

I am trying to write binary data to network path but it fails with error : "Invalid URI :  Hostname could not be parsed."

Can you please help me out with this. I am trying to write data to network file path e.g.  "\\abc.xyz.com\Automation\OutSystems". Not sure why this error is thrown. Below is the parameter passed:

Domain: "\\abc.xyz.com"

HostName: "\\abc.xyz.com"

Share :  "Automation"

FilePath : "OutSystems\"+FileName

2023-11-10 11-46-42
Diogo Barbosa

Hostname doesn't need the slashes "\\", neither the domain... try "acb.xyz.com" on both.

UserImage.jpg
Jyotsna Patil

I also tried this but it throws different error : Failed to connect to server

2024-01-16 23-21-55
Chris Palka

Same issue. I've tried every single iteration. Which leads me to believe this is a networking issue. Even though the parsing of the URI seems to be whacky, duplicating "/".

UserImage.jpg
Kant Chan

Hi Fernandes,

I can understand the other parameters but  what is the input format for "Authentication"?


2021-05-24 21-41-02
Denise Pedro

Authentication is a Structure with Domain, Username and Password attributes.

2023-11-10 11-46-42
Diogo Barbosa

Yes, we need to click the '+' to open it...

2023-11-10 11-46-42
Diogo Barbosa

The ReadFile works great!

But the ListFiles returns empty... anyone with a solution?

2023-11-10 11-46-42
Diogo Barbosa

Well, it has to be run from a SERVER ACTION. Then it works fine!

UserImage.jpg
LOKESH KUMAR THENNARASU

Can anyone help me on this:


PATH: \\XH-CON-IB-10203\SharedTXT\Sampletxt1.xml 

Domain:"XH-CON-IB-10203"

Host:"XH-CON-IB-10203" 


I'm Getting: Im getting: An error was raised by the application: No such host is known

I took the host name from the cmd by typing hostname



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.