invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Process File Uploads

Files can be presented for use in Invantive UniversalSQL using the following steps:

  • Use one POST parameter per file.
  • Define in the preset a parameter of type ByteArray with a name identical to the POST parameter.
  • The parameter can be used in Invantive UniversalSQL.

Examples

HTML Code

<body>
  <form action="/Preset?preset=some-preset" method="POST" enctype="multipart/form-data">
    <ul>
      <li>
        <label class="label">File</label>
        <input type="file" title="Choose file." name="upload_file">
      </li>
    </ul>
    <div class="buttonbar">
      <button class="requestButton download" type="submit">Download</button>
    </div>
  </form>
</body>

Preset File

<?xml version="1.0" encoding="utf-8" ?>
<PresetInfo>
  <Action>Results</Action>
  <Code>SOME-CODE</Code>
  <SqlFile>some-code.sql</SqlFile>
  <Format>Xlsx</Format>
  <ConnectionName>...\...</ConnectionName>
  <ParameterValues>
    <Parameter>
      <Name>upload_file</Name>
      <DotnetDataType>ByteArray</DotnetDataType>
    </Parameter>
  </ParameterValues>
</PresetInfo>

SQL Code

select *
from   exceltable
       ( table 'Sheet1'
         passing :upload_file
         columns some_column varchar2 position 1
       )

Release Notes