title: Cannot create the generated HTTP client's required return type, since no TypeConverter from ByteBuffer to class java.io.File : Micronaut
body: <p>Below is the server side code for sending file to client as rest response using micronaut. </p>
  
  <pre><code>@Get(value = "/downloadFile", produces = MediaType.APPLICATION_OCTET_STREAM )
  public HttpResponse&lt;File&gt; downloadDocument() throws IOException {
  
      File sampleDocumentFile = new File(getClass().getClassLoader().getResource("SampleDocument.pdf").getFile());
  
      return HttpResponse.ok(sampleDocumentFile).header("Content-Disposition", "attachment; filename=\"" + sampleDocumentFile.getName() + "\"" );
  }
  </code></pre>
  
  <p>Below is the client for calling the above endpoint.</p>
  
  <pre><code>@Client(value = "/client")
  public interface DownloadDocumentClient {
  
  @Get(value = "/downloadDocument", processes = MediaType.APPLICATION_OCTET_STREAM)
  public Flowable&lt;File&gt; downloadDocument();
  
  }
  </code></pre>
  
  <p>Tried to retreive file as below :-</p>
  
  <pre><code>Flowable&lt;File&gt; fileFlowable = downloadDocumentClient.downloadDocument();
      Maybe&lt;File&gt; fileMaybe = fileFlowable.firstElement();
      return fileMaybe.blockingGet();
  </code></pre>
  
  <p>Getting exception as </p>
  
  <blockquote>
    <p>io.micronaut.context.exceptions.ConfigurationException: Cannot create
    the generated HTTP client's required return type, since no
    TypeConverter from ByteBuffer to class java.io.File is registered</p>
  </blockquote>