title: image not getting displayed on html page using sails js
body: <p>I am using sails Js and Mongo DB in my application. I upload an image and content for a blog post. I save it in images folder.I save the file destination and content to my mongodb. using the file destination, I want to display the content and image in my HTML page. Content is being displayed but image is not getting displayed.
  controller:</p>
  <pre><code>savepost:function(req,res){
          var uploadFile=req.file(&quot;image&quot;)
          uploadFile.upload({maxBytes:1000000,dirname:'../../assets/images'}, function onUploadComplete(err, files) {
              // Files will be uploaded to ./assets/images
              // Access it via localhost:1337/images/file-name
              if (err) return res.serverError(err);
              // IF ERROR Return and send 500 error
              filename=files[0].fd;
          var content=req.body.content;
          var title=req.body.title;
         Cyberblog.create({title:title,content:content,date:date,filename:filename,}).exec(function(err){
              if(err){
                console.log(err);
                message=&quot;content not saved&quot;;
                  console.log(message)
                res.redirect('/newpost');
              }
              else{
       var start=filename.lastIndexOf('\\');
       fd=&quot;images/&quot;+filename.substring(start+1)
        post={
            title:title,
            content:content,
            fd:fd,
        }
        res.view('pages/blog/blog',{post:post})
      console.log(&quot;succesfully saved&quot;)}
      }); }); },
  </code></pre>
  <p>Html file:</p>
  <pre><code>&lt;div class=&quot;container&quot;&gt;
        &lt;div class=&quot;row align-items-stretch retro-layout-2&quot;&gt;
          &lt;div class=&quot;col-md-4&quot;&gt;
            &lt;a href=&quot;single.html&quot; class=&quot;h-entry mb-30 v-height gradient&quot; style=&quot;background-image:url(&lt;%= post.fd %&gt;);&quot;&gt;
              &lt;div class=&quot;text&quot;&gt;
                &lt;h2&gt;&lt;%= post.title %&gt;&lt;/h2&gt;
              &lt;/div&gt;
            &lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  </code></pre>
  <p>I am unable to figure out if this is correct or not &lt;%= post.fd %&gt;. Please help me.</p>