{"id":1189,"date":"2025-10-09T07:17:43","date_gmt":"2025-10-09T00:17:43","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/atlasx-web-service-v8-0\/features\/connect-to-storage\/"},"modified":"2026-03-27T09:01:16","modified_gmt":"2026-03-27T02:01:16","slug":"connect-to-storage","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/axws\/features\/connect-to-storage\/","title":{"rendered":"Connect to storage"},"content":{"rendered":"\n\n\n<p>AtlasX Web Service \u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e44\u0e1f\u0e25\u0e4c\u0e44\u0e14\u0e49\u0e2b\u0e25\u0e32\u0e22\u0e41\u0e2b\u0e25\u0e48\u0e07\u0e1e\u0e23\u0e49\u0e2d\u0e21\u0e01\u0e31\u0e19 \u0e17\u0e31\u0e49\u0e07 local folder \u0e41\u0e25\u0e30 network drive \u0e42\u0e14\u0e22\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e04\u0e48\u0e32\u0e44\u0e27\u0e49\u0e43\u0e19 configuration \u0e41\u0e25\u0e30\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1c\u0e48\u0e32\u0e19&nbsp;<code>IDirectoryAccessService<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32<\/strong><\/h2>\n\n\n\n<p>\u0e01\u0e33\u0e2b\u0e19\u0e14 file sources \u0e43\u0e19&nbsp;<code>appsettings.json<\/code><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>{\n  \"App\": {\n    \"FileServer\": {\n      \"DefaultFileSource\": \"Default\",\n      \"FileSourceParameter\": \"APP_FILE_SOURCE\",\n      \"FilePathParameter\": \"APP_FILE_PATH\",\n      \"FileSource\": {\n        \"Default\": {\n          \"RemotePath\": \"FilesLocalStorage\"\n        },\n        \"NetworkDriveEx\": {\n          \"RemotePath\": \"\\\\\\\\mynetworkdrive\\\\d$\\\\Shared Files\",\n          \"Username\": \"admin\",\n          \"Password\": \"password\",\n          \"Domain\": \"\"\n        }\n      }\n    }\n  }\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #A31515\">&quot;App&quot;<\/span><span style=\"color: #000000\">: {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #A31515\">&quot;FileServer&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;DefaultFileSource&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;Default&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;FileSourceParameter&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;APP_FILE_SOURCE&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;FilePathParameter&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;APP_FILE_PATH&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #A31515\">&quot;FileSource&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #A31515\">&quot;Default&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">          <\/span><span style=\"color: #A31515\">&quot;RemotePath&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;FilesLocalStorage&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        },<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        <\/span><span style=\"color: #A31515\">&quot;NetworkDriveEx&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">          <\/span><span style=\"color: #A31515\">&quot;RemotePath&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;<\/span><span style=\"color: #EE0000\">\\\\\\\\<\/span><span style=\"color: #A31515\">mynetworkdrive<\/span><span style=\"color: #EE0000\">\\\\<\/span><span style=\"color: #A31515\">d$<\/span><span style=\"color: #EE0000\">\\\\<\/span><span style=\"color: #A31515\">Shared Files&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">          <\/span><span style=\"color: #A31515\">&quot;Username&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;admin&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">          <\/span><span style=\"color: #A31515\">&quot;Password&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;password&quot;<\/span><span style=\"color: #000000\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">          <\/span><span style=\"color: #A31515\">&quot;Domain&quot;<\/span><span style=\"color: #001080\">:<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&quot;&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">\u0e23\u0e30\u0e1a\u0e1a\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a file source 2 \u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17<\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17<\/strong><\/td><td><strong>RemotePath<\/strong><\/td><\/tr><tr><td>Local folder<\/td><td>\u0e0a\u0e37\u0e48\u0e2d folder \u0e40\u0e0a\u0e48\u0e19&nbsp;<code>FilesLocalStorage<\/code><\/td><\/tr><tr><td>Network drive<\/td><td>UNC path \u0e40\u0e0a\u0e48\u0e19&nbsp;<code>\\\\server\\share<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">FileServer<\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Field<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>DefaultFileSource<\/code><\/td><td>\u0e0a\u0e37\u0e48\u0e2d file source \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e44\u0e21\u0e48\u0e23\u0e30\u0e1a\u0e38 file source \u0e15\u0e2d\u0e19\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/td><\/tr><tr><td><code>FileSourceParameter<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e37\u0e48\u0e2d key \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e30\u0e1a\u0e38 file source \u0e15\u0e2d\u0e19\u0e40\u0e23\u0e35\u0e22\u0e01&nbsp;<code>CreateDirectoryAccess()<\/code>&nbsp;\u0e16\u0e49\u0e32\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e1b\u0e47\u0e19&nbsp;<code>APP_FILE_SOURCE<\/code>&nbsp;\u0e01\u0e47\u0e15\u0e49\u0e2d\u0e07\u0e2a\u0e48\u0e07 key \u0e0a\u0e37\u0e48\u0e2d\u0e19\u0e35\u0e49\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e43\u0e19 parameters<\/td><\/tr><tr><td><code>FilePathParameter<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e37\u0e48\u0e2d key \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e23\u0e30\u0e1a\u0e38 path \u0e15\u0e2d\u0e19\u0e40\u0e23\u0e35\u0e22\u0e01&nbsp;<code>CreateDirectoryAccess()<\/code>&nbsp;\u0e16\u0e49\u0e32\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e1b\u0e47\u0e19&nbsp;<code>APP_FILE_PATH<\/code>&nbsp;\u0e01\u0e47\u0e15\u0e49\u0e2d\u0e07\u0e2a\u0e48\u0e07 key \u0e0a\u0e37\u0e48\u0e2d\u0e19\u0e35\u0e49\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e43\u0e19 parameters<\/td><\/tr><tr><td><code>FileSource<\/code><\/td><td>\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 file sources \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e0a\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e47\u0e19 key \u0e40\u0e0a\u0e48\u0e19&nbsp;<code>Default<\/code>,&nbsp;<code>NetworkDriveEx<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">FileSource<\/h3>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>Field<\/strong><\/td><td><strong>Required<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><code>RemotePath<\/code><\/td><td>Required<\/td><td>Path \u0e02\u0e2d\u0e07 file source \u0e16\u0e49\u0e32\u0e40\u0e1b\u0e47\u0e19 local folder \u0e43\u0e0a\u0e49\u0e0a\u0e37\u0e48\u0e2d folder \u0e16\u0e49\u0e32\u0e40\u0e1b\u0e47\u0e19 network drive \u0e43\u0e0a\u0e49 UNC path \u0e40\u0e0a\u0e48\u0e19&nbsp;<code>\\\\server\\share<\/code><\/td><\/tr><tr><td><code>Username<\/code><\/td><td>Optional<\/td><td>\u0e0a\u0e37\u0e48\u0e2d\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a authentication \u0e43\u0e0a\u0e49\u0e40\u0e09\u0e1e\u0e32\u0e30 network drive<\/td><\/tr><tr><td><code>Password<\/code><\/td><td>Optional<\/td><td>\u0e23\u0e2b\u0e31\u0e2a\u0e1c\u0e48\u0e32\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a authentication \u0e43\u0e0a\u0e49\u0e40\u0e09\u0e1e\u0e32\u0e30 network drive<\/td><\/tr><tr><td><code>Domain<\/code><\/td><td>Optional<\/td><td>Domain \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a authentication \u0e43\u0e0a\u0e49\u0e40\u0e09\u0e1e\u0e32\u0e30 network drive \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 domain<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Service Registration<\/h2>\n\n\n\n<p>\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19 DirectoryAccess \u0e40\u0e02\u0e49\u0e32 DI container \u0e43\u0e19 <code>Program.cs<\/code><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>using AtlasX.Engine.RemoteDirectory.Services;\n\nbuilder.Services.AddDirectoryAccess(builder.Configuration, \"App:FileServer\");<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">using<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4FC1FF\">AtlasX<\/span><span style=\"color: #D4D4D4\">.Engine.RemoteDirectory.Services;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Services<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">AddDirectoryAccess<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">builder<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">Configuration<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;App:FileServer&quot;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Inject IDirectoryAccessService<\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>public class MyService\n{\n    private readonly IDirectoryAccessService _directoryAccess;\n\n    public MyService(IDirectoryAccessService directoryAccess)\n    {\n        _directoryAccess = directoryAccess;\n    }\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #9CDCFE\">public<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">class<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #4EC9B0\">MyService<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">private<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #569CD6\">readonly<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">IDirectoryAccessService<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    <\/span><span style=\"color: #569CD6\">public<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #DCDCAA\">MyService<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">IDirectoryAccessService<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">directoryAccess<\/span><span style=\"color: #D4D4D4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">        <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">directoryAccess<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\"><strong>Save<\/strong> <strong>Files<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ Default file source\nvar directory = _directoryAccess.GetFileSource();\ndirectory.PathName = \"uploads\/images\";\ndirectory.SaveFile(\"photo.jpg\", fileBytes);\n\n\/\/ \u0e23\u0e30\u0e1a\u0e38 file source\nvar directory = _directoryAccess.GetFileSource(\"NetworkDriveEx\");\ndirectory.PathName = \"uploads\/documents\";\ndirectory.SaveFile(\"report.pdf\", fileBytes);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A9955\">\/\/ Default file source<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetFileSource<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">PathName<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;uploads\/images&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">SaveFile<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;photo.jpg&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">fileBytes<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A9955\">\/\/ \u0e23\u0e30\u0e1a\u0e38 file source<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetFileSource<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;NetworkDriveEx&quot;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">PathName<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;uploads\/documents&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">SaveFile<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;report.pdf&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">fileBytes<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\"><strong>Get File<\/strong><\/h3>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>var directory = _directoryAccess.GetFileSource();\ndirectory.PathName = \"uploads\/images\";\nvar stream = directory.GetFile(\"photo.jpg\");<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetFileSource<\/span><span style=\"color: #D4D4D4\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #9CDCFE\">PathName<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #CE9178\">&quot;uploads\/images&quot;<\/span><span style=\"color: #D4D4D4\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">stream<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">GetFile<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;photo.jpg&quot;<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-group is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\"><strong>Create Directory Access from Parameters<\/strong><\/h3>\n\n\n\n<p>\u0e01\u0e23\u0e13\u0e35\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e1c\u0e39\u0e49\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e01\u0e33\u0e2b\u0e19\u0e14 file source \u0e41\u0e25\u0e30 path \u0e40\u0e2d\u0e07\u0e15\u0e2d\u0e19 runtime \u0e43\u0e0a\u0e49 <code>CreateDirectoryAccess()<\/code> \u0e41\u0e17\u0e19 <code>GetFileSource()<\/code><\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#D4D4D4;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>var parameters = new Dictionary&lt;string, object>\n{\n    { \"APP_FILE_SOURCE\", \"NetworkDriveEx\" }, \/\/ \u0e23\u0e30\u0e1a\u0e38\u0e27\u0e48\u0e32\u0e43\u0e0a\u0e49 NetworkDriveEx\n    { \"APP_FILE_PATH\", \"uploads\/documents\" }\n};\n\nvar directory = _directoryAccess.CreateDirectoryAccess(parameters);\ndirectory.SaveFile(\"report.pdf\", fileBytes);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki dark-plus\" style=\"background-color: #1E1E1E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">parameters<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #569CD6\">new<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">Dictionary<\/span><span style=\"color: #D4D4D4\">&lt;<\/span><span style=\"color: #9CDCFE\">string<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">object<\/span><span style=\"color: #D4D4D4\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    { <\/span><span style=\"color: #CE9178\">&quot;APP_FILE_SOURCE&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;NetworkDriveEx&quot;<\/span><span style=\"color: #D4D4D4\"> }, <\/span><span style=\"color: #6A9955\">\/\/ \u0e23\u0e30\u0e1a\u0e38\u0e27\u0e48\u0e32\u0e43\u0e0a\u0e49 NetworkDriveEx<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">    { <\/span><span style=\"color: #CE9178\">&quot;APP_FILE_PATH&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #CE9178\">&quot;uploads\/documents&quot;<\/span><span style=\"color: #D4D4D4\"> }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D4D4D4\">};<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #569CD6\">var<\/span><span style=\"color: #D4D4D4\"> <\/span><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\"> = <\/span><span style=\"color: #9CDCFE\">_directoryAccess<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">CreateDirectoryAccess<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #9CDCFE\">parameters<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #9CDCFE\">directory<\/span><span style=\"color: #D4D4D4\">.<\/span><span style=\"color: #DCDCAA\">SaveFile<\/span><span style=\"color: #D4D4D4\">(<\/span><span style=\"color: #CE9178\">&quot;report.pdf&quot;<\/span><span style=\"color: #D4D4D4\">, <\/span><span style=\"color: #9CDCFE\">fileBytes<\/span><span style=\"color: #D4D4D4\">);<\/span><\/span><\/code><\/pre><\/div>\n<\/div>\n\n\n\n<p><\/p>\n","protected":false},"featured_media":0,"parent":1186,"menu_order":2,"comment_status":"open","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-1189","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=1189"}],"version-history":[{"count":12,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1189\/revisions"}],"predecessor-version":[{"id":4229,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1189\/revisions\/4229"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1186"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=1189"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=1189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}