> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GPUdb.FileHandler

> GPUdb.FileHandler — Kinetica API

<div className="kinetica-jsdoc">
  <h1 className="page-title">Class: FileHandler</h1>

  <div className="section">
    <div className="header">
      <h2><span className="attribs"><span className="type-signature" /></span> <span className="ancestors"><a href="/content/api/nodejs/GPUdb">GPUdb</a>.</span>FileHandler<span className="signature">(gpuDB<span className="signature-attributes">opt</span>)</span><span className="type-signature" /></h2>
      <div className="class-description">FileHandler API object that provides access to KIFS server functions.</div>
    </div>

    <div className="article">
      <div className="container-overview">
        <h2>Constructor</h2>
        <h4 className="name" id="FileHandler"><span className="type-signature" />new FileHandler<span className="signature">(gpuDB<span className="signature-attributes">opt</span>)</span><span className="type-signature" /></h4>
        <div className="description"> Creates a FileHandler object </div>
        <h5>Parameters:</h5>

        <table className="params">
          <thead>
            <tr>
              <th>Name</th>
              <th>Type</th>
              <th>Attributes</th>
              <th className="last">Description</th>
            </tr>
          </thead>

          <tbody>
            <tr>
              <td className="name"><code>gpuDB</code></td>
              <td className="type"> <span className="param-type">Object</span> </td>
              <td className="attributes"> \<optional><br /> </td>
              <td className="description last">GPUdb API object that provides access to GPUdb server functions.</td>
            </tr>
          </tbody>
        </table>

        <div className="dl details">
          <div className="dt tag-source">Source:</div>

          <div className="dd tag-source">
            <ul className="dummy">
              <li> , </li>
            </ul>
          </div>
        </div>
      </div>

      <h3 className="subsection-title">Methods</h3>
      <h4 className="name" id="download"><span className="type-signature" />download<span className="signature">(filenames, options)</span><span className="type-signature"> → {"{"}Promise{"}"}</span></h4>
      <div className="description"> Downloads the list of files from KIFS to local filesystem. </div>
      <h5>Parameters:</h5>

      <table className="params">
        <thead>
          <tr>
            <th>Name</th>
            <th>Type</th>
            <th className="last">Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td className="name"><code>filenames</code></td>
            <td className="type"> <span className="param-type">Array</span> </td>
            <td className="description last">Filepaths for KIFS files to be downloaded.</td>
          </tr>

          <tr>
            <td className="name"><code>options</code></td>
            <td className="type"> <span className="param-type">Map</span> </td>
            <td className="description last">Download options. A placeholder for future options.</td>
          </tr>
        </tbody>
      </table>

      <div className="dl details">
        <div className="dt tag-source">Source:</div>

        <div className="dd tag-source">
          <ul className="dummy">
            <li> , </li>
          </ul>
        </div>
      </div>

      <h5>Returns:</h5>
      <div className="param-desc"> A promise that will be fulfilled with object, if no callback function is provided. Returns an array containing base64 file data. </div>

      <div className="dl">
        <div className="dt"> Type </div>
        <div className="dd"> <span className="param-type">Promise</span> </div>
      </div>

      <h4 className="name" id="download_and_save"><span className="type-signature" />download\_and\_save<span className="signature">(filenames, destination, options)</span><span className="type-signature"> → {"{"}Promise{"}"}</span></h4>
      <div className="description"> Downloads the list of files from KIFS to local filesystem. </div>
      <h5>Parameters:</h5>

      <table className="params">
        <thead>
          <tr>
            <th>Name</th>
            <th>Type</th>
            <th className="last">Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td className="name"><code>filenames</code></td>
            <td className="type"> <span className="param-type">Array</span> </td>
            <td className="description last">Filepaths for KIFS files to be downloaded.</td>
          </tr>

          <tr>
            <td className="name"><code>destination</code></td>
            <td className="type"> <span className="param-type">String</span> </td>
            <td className="description last">Destination FS local path</td>
          </tr>

          <tr>
            <td className="name"><code>options</code></td>
            <td className="type"> <span className="param-type">Map</span> </td>
            <td className="description last">Download options A placeholder for future options.</td>
          </tr>
        </tbody>
      </table>

      <div className="dl details">
        <div className="dt tag-source">Source:</div>

        <div className="dd tag-source">
          <ul className="dummy">
            <li> , </li>
          </ul>
        </div>
      </div>

      <h5>Returns:</h5>
      <div className="param-desc"> A promise that will be fulfilled with the response object, if no callback function is provided. </div>

      <div className="dl">
        <div className="dt"> Type </div>
        <div className="dd"> <span className="param-type">Promise</span> </div>
      </div>

      <h4 className="name" id="upload"><span className="type-signature" />upload<span className="signature">(filenames, destination, options)</span><span className="type-signature"> → {"{"}Promise{"}"}</span></h4>
      <div className="description"> Uploads the list of files from local filesystem to KIFS. </div>
      <h5>Parameters:</h5>

      <table className="params">
        <thead>
          <tr>
            <th>Name</th>
            <th>Type</th>
            <th className="last">Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td className="name"><code>filenames</code></td>
            <td className="type"> <span className="param-type">Object</span> </td>
            <td className="description last">Files to be uploaded. Can be a single string or multiple strings containing the full path of the files, or file objects (single or multiple) containing the file data.</td>
          </tr>

          <tr>
            <td className="name"><code>destination</code></td>
            <td className="type"> <span className="param-type">String</span> </td>
            <td className="description last">Destination kifs path</td>
          </tr>

          <tr>
            <td className="name"><code>options</code></td>
            <td className="type"> <span className="param-type">Map</span> </td>
            <td className="description last">Upload options A placeholder for future options.</td>
          </tr>
        </tbody>
      </table>

      <div className="dl details">
        <div className="dt tag-source">Source:</div>

        <div className="dd tag-source">
          <ul className="dummy">
            <li> , </li>
          </ul>
        </div>
      </div>

      <h5>Returns:</h5>
      <div className="param-desc"> A promise that will be fulfilled with true for success and false for faliure (if no callback function is provided). </div>

      <div className="dl">
        <div className="dt"> Type </div>
        <div className="dd"> <span className="param-type">Promise</span> </div>
      </div>
    </div>
  </div>
</div>
