title: Function should be returning a promise of a string but doesn't
body: <p>I'm trying to upload an image and return it's id with the following code:</p>
  
  <pre><code>export function uploadImage(file: any, location: string, next: any): Promise&lt;string&gt; {
      try {
          if (!file) {
              throw new Error("No Image file");
          }
          const id = location + "/" + utilities.generatePushID();
          const options = {
              resource_type: "raw",
              public_id: id,
          };
          return cloudinary.uploader.upload_stream(options, (error: any, result: any) =&gt; {
              if (error) {
                   throw new Error("Couldn't upload");
               }
               return result.public_id;
          }).end(file.buffer);
      } catch (err) {
           return next(InternalError(err));
      }
  }
  </code></pre>
  
  <p>However, whenever I try to call the function, it gives me back an <code>UploadStream</code> object rather than the <code>string</code> that I want. It's as if it immediately returns the uploader, rather than the result of the uploader. Why?</p>