title: data is showing undefine how would it could correct
body: <p>This is <strong>error</strong>:</p>
  <blockquote>
  <p>D:\LCO bootcamp\Project_Backend\controllers\product.js:50
  product.photo.data = fs.readFileSync(file.photo.path);
  ^</p>
  <p>TypeError: Cannot set properties of undefined (setting 'data')</p>
  </blockquote>
  <p>Code:</p>
  <pre><code>if (file.photo) {
        if (file.photo.size &gt; 3000000) {
          return res.status(400).json({
            error: &quot;File size too big!&quot;
          });
      }
  
        
        product.photo.data = fs.readFileSync(file.photo.filepath);
        product.photo.contentType = file.photo.mimetype;
  }
  </code></pre>
  <p>'</p>