<?xml version="1.0" encoding="utf-8"?>
<KScriptSetting>
  <Name>Upload File</Name>
  <Description></Description>
  <Example>

    <![CDATA[
  
 <script engine="kscript">
    if (k.request.method="POST")
       {      
        if (k.request.files.count>0)
           { 
 
       k.request.files.forEach(function(item)
        { 
         k.response.write(item.fileName); 
         item.save(item.fileName);  
        })  
      }   
    }
</script>

<div>
    <form action="" method="post" enctype="multipart/form-data">
        <input type="file" class="file1" name="file1">
        <input type="file" class="file1" name="file2">
        <button type="submit" class="but1">Submit</button>
    </form>
</div> 
    ]]>  
    
  </Example>
  <Props>
    <Property>
      <Name>ContentType</Name>
      <Description>ContentType</Description>
      <Type>string</Type>
    </Property>
    <Property>
      <Name>FileName</Name>
      <Description>FileName</Description>
      <Type>string</Type>
    </Property>
    <Property>
      <Name>Bytes</Name>
      <Description>The binary bytes array</Description>
      <Type>array</Type>
    </Property>
   
  </Props>
  <Methods>
    <Method>
      <Name>save</Name>
      <Description>save the file into disk</Description>
      <Example>
        <![CDATA[
  
 <script engine="kscript">
    if (k.request.method="POST")
       {      
        if (k.request.files.count>0)
           { 
 
       k.request.files.forEach(function(item)
        { 
         k.response.write(item.fileName); 
         item.save(item.fileName);  
        })  
      }   
    }
</script>

<div>
    <form action="" method="post" enctype="multipart/form-data">
        <input type="file" class="file1" name="file1">
        <input type="file" class="file1" name="file2">
        <button type="submit" class="but1">Submit</button>
    </form>
</div> 
    ]]>
      </Example>
      <Params>
        <Param>
          <Name>filename</Name>
          <Description>the full relative file name includes folders if any.</Description>
          <Type>string</Type>
        </Param>
      </Params>
      <ReturnType>string</ReturnType>
    </Method>
  </Methods>
</KScriptSetting>