title: show uploaded image yii
body: <p>I am new to php and yii. I have a file field in my form to upload images. I use the following code to upload the image using file field.</p>
  
  <p>Code in View: </p>
  
  <pre><code>&lt;?php echo $form-&gt;fileField($model,'logo', array('class'=&gt;'input-file')); ?&gt;
      &lt;img src="&lt;?php 
          echo Yii::app()-&gt;request-&gt;baseUrl.'/protected/uploads/sitelogo/'.$savedvalues['varLogo']; 
      ?&gt;" width="50" height="50" /&gt;
      &lt;?php echo $form-&gt;hiddenField($model,'hiddenfile',
              array('value'=&gt;$savedvalues['varLogo'])); ?&gt; 
  </code></pre>
  
  <p>code in controller:</p>
  
  <pre><code>$randnum = rand(0,100);
  $home-&gt;varLogo = $randnum.$model-&gt;logo;
  $file= Yii::app()-&gt;getBasePath().'/uploads/sitelogo/'.$randnum.$model-&gt;logo;
  $model-&gt;logo-&gt;saveAs($file);    
  </code></pre>
  
  <p>The images are uploading fine now. I have saved the uploaded images in <code>protected\uploads\</code> folder. I am trying to show the uploaded image in edit image section. But the image doesn't display. It Shows <code>failed to load the given url</code> in firebug. </p>
  
  <p>How can i correct this issue?</p>