title: Cloudinary File-Upload/ReactJs/Express Node Unable to get response
body: <p>Trying to get file-uploading work using Express/Node on cloudinary with no luck.I'm able to post the request,my file gets uploaded to the cloudinary server but never gets a response resulting in my request to time out.I'm using [express-file-upload][1] to send the data to cloudinary as a stream of bits and axios to post it.</p>
  
  <p>My Express router API code:</p>
  
  <pre><code>const fileUpload = require("express-fileupload");
  const cloudinary = require("cloudinary");
  
      router.use(fileUpload());
  
      cloudinary.config({
          cloud_name: "xyx",
          api_key: "xyxxyxxyxxyxxyx",
          api_secret: "xyxxyxxyxxyxxyxxyx"
      });
  
      router.post("/upload", function(req, res, next) {
          console.log(req);
          var fileGettingUploaded = req.files.file.data;
  
          cloudinary.uploader
              .upload_stream({ resource_type: "raw" }, function(error, result) {
                  console.log(error);
                  console.log(result);
              })
              .end(fileGettingUploaded);
      });
  
    [1]: https://www.npmjs.com/package/express-fileupload
  </code></pre>
  
  <p>My Axios Post Request from the component</p>
  
  <pre><code>const { fileName } = this.state;
          const formData = new FormData();
          formData.append("file", fileName);
          const url = `/api/upload`;
          axiosInstance
              .post(url, formData, {
                  headers: {
                      "Content-Type": fileName.type
                  }
              })
              .then(response =&gt; {
                  if (response.status === 200 &amp;&amp; response.data) {
                      console.log(response);
                  }
              })
              .catch(error =&gt; {
                  console.log(error);
              });
      };
  </code></pre>
  
  <p>This results in a request which successfully uploads my file to cloudinary (I can see the uploaded file in the cloudinary's dashboard) but unable to give me a response which ideally should be a url to the uploaded file.Can anyone guide me what I'm doing wrong ?</p>