title: Cloud Function - Getting file contents more than 10 MB
body: <p>The Google Cloud Function's quota page: <a href="https://cloud.google.com/functions/quotas" rel="nofollow noreferrer">https://cloud.google.com/functions/quotas</a> says that the Maximum amount of Data sent by HTTP Function in an HTTP Response is 10 MB. I have files of 100 MB in Google Storage Bucket which I want to stream from the Cloud Function to my application. Due to security aspects of our architecture, my application cannot read directly from the Storage Bucket.</p>
  
  <p>A Sample Go Code in the Cloud Function is:</p>
  
  <pre><code>func MyFn(w http.ResponseWriter, r *http.Request) {
  
      var appendedBytes []byte
      for {
          decryptedFileBuffer, err := fh.GetNextDecryptedPage()
          if err != nil {
              break
          }
          appendedBytes = append(appendedBytes, decryptedFileBuffer...)
      }
      w.Write(appendedBytes)
  }
  </code></pre>
  
  <p>If I try to get files more than 10 MB using Cloud Function, I get following errors:</p>
  
  <blockquote>
    <p>Error: incorrect function response. Function invocation was
    interrupted.</p>
    
    <p>Error: could not handle the request</p>
  </blockquote>
  
  <p>How can I get files from than 10 MB from the Cloud Function?</p>