title: Upload profile photo to salecforce via jsforce
body: <p>I want to upload profile photo to salecforce via jsforce,
  but for some reason I can't using this code</p>
  <pre><code>  let fileOnServer = &quot;./files/photo.jpg&quot;, // static photo url
      fileName = &quot;Contact Picture&quot;,
      fileType = &quot;image/jpeg&quot;;
    fs.readFile(fileOnServer, function (err, data) {
      if (err) {
        console.log(err);
        res.status(404).send({ errorMessage: err });
      } else {
        let base64data = new Buffer(data).toString(&quot;base64&quot;);
        JSFORCE_CONNECTION.sobject(&quot;Attachment&quot;).create(
          {
            ParentId: &quot;0034K000004ZpFcQAK&quot;,
            Name: fileName,
            Body: base64data,
            ContentType: fileType,
          },
          function (err, ret) {
            if (err || !ret.success) {
              res.send(&quot;error&quot;);
              return console.error(&quot;error&quot;, err, ret);
            }
            console.log(&quot;Created Successfully : &quot; + ret.id, ret);
            res.send(&quot;created&quot;);
          }
        );
      }
    });
  };```
  </code></pre>