<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Copying Files using Rest API in ONTAP Rest API Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454433#M692</link>
    <description>This is how I extracted the file from the multipart/form-data Using .Net Microsoft.AspNetCore.WebUtilities package: Use the collection of HttpResponseMessage Headers ContentType Parameters to find the name value pair with a name of "boundary". Use the header boundary value in the MultipartReader and read each section of the response. If the section MediaType is "text/plain" and Name is "bytes_read", read the number of bytes from the body. If the section MediaType is "application/octet-stream", stream the body. section.Body.CopyToAsync(…);</description>
    <pubDate>Mon, 12 Aug 2024 16:26:04 GMT</pubDate>
    <dc:creator>RubyWren</dc:creator>
    <dc:date>2024-08-12T16:26:04Z</dc:date>
    <item>
      <title>Copying Files using Rest API</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454365#M690</link>
      <description>&lt;P&gt;I would like to read or download files from a volume using the ONTAP Rest API. The “storage/file/copy” is not appropriate as the destination is a container. I can read the files using “storage/volumes/{volume.uuid}/files/{path}…” however the output contains unwanted content. In an example file that contains two lines: “This is a test file.” and Lorem… The result is:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;--b62dcee24b2e7920
Content-Disposition: form-data; name="bytes_read"
Content-Type: text/plain

469
--b62dcee24b2e7920
Content-Disposition: form-data; filename="NewTest.txt"
Content-Type: application/octet-stream

This is a test file.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

--b62dcee24b2e7920--&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Is there a way to make an exact copy of files using the API?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 19:47:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454365#M690</guid>
      <dc:creator>RubyWren</dc:creator>
      <dc:date>2024-08-07T19:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Files using Rest API</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454376#M691</link>
      <description>&lt;P&gt;I see the note: The contents of the file will be stored in the variable "response_files" in the return object. The output does not look like Json that can be parsed for response_files. Is this what the note is stating?&lt;/P&gt;&lt;H2&gt;file-read-file&lt;/H2&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;GET&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/api/storage/volumes/{volume.uuid}/files/{path}&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;You MUST include \{ "Accept" : "multipart/form-data" \} in the header. The contents of the file will be stored in the variable "response_files" in the return object.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Aug 2024 17:53:38 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454376#M691</guid>
      <dc:creator>RubyWren</dc:creator>
      <dc:date>2024-08-08T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Copying Files using Rest API</title>
      <link>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454433#M692</link>
      <description>This is how I extracted the file from the multipart/form-data Using .Net Microsoft.AspNetCore.WebUtilities package: Use the collection of HttpResponseMessage Headers ContentType Parameters to find the name value pair with a name of "boundary". Use the header boundary value in the MultipartReader and read each section of the response. If the section MediaType is "text/plain" and Name is "bytes_read", read the number of bytes from the body. If the section MediaType is "application/octet-stream", stream the body. section.Body.CopyToAsync(…);</description>
      <pubDate>Mon, 12 Aug 2024 16:26:04 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Rest-API-Discussions/Copying-Files-using-Rest-API/m-p/454433#M692</guid>
      <dc:creator>RubyWren</dc:creator>
      <dc:date>2024-08-12T16:26:04Z</dc:date>
    </item>
  </channel>
</rss>

