title: Image doesn't upload in custom module magento
body: <p>I have created custom module in magento with image upload attribute. Image name was successfully stored in DB table. But image doesn't upload to the target folder. </p>
  
  <p>I have tried with this following code. please show me "what am i doing wrong here"</p>
  
  <pre><code>     $uploader = new Varien_File_Uploader('fileinputname');
       $uploader-&gt;setAllowedExtensions(array('jpg','jpeg','gif','png'));
       $uploader-&gt;setAllowRenameFiles(false);
       $uploader-&gt;setFilesDispersion(false);
  
       $path = Mage::getBaseDir('media') .DS. 'foo'.DS ;
       $uploader-&gt;save($path, $_FILES['fileinputname']['name']);
  </code></pre>