Magento のカスタム モジュールで画像をアップロードする際に問題が発生しました。
私はこの目的のためにコアphp ccodingを使用しましたが、magentoは画像をアップロードしていません..
同じコードを使用して、ローカルの xampp にファイルをアップロードしました。しかし、そのコードは私のサーバーでは機能していません..
私もこのコードを使用していますが、機能していません....
$path = Mage::getBaseDir().DS.'customer_documents'.DS; //desitnation directory
$fname = $_FILES['docname']['name']; //file name
$uploader = new Varien_File_Uploader('docname'); //load class
$uploader->setAllowedExtensions(array('doc','pdf','txt','docx')); //Allowed extension for file
$uploader->setAllowCreateFolders(true); //for creating the directory if not exists
$uploader->setAllowRenameFiles(false); //if true, uploaded file's name will be changed, if file with the same name already exists directory.
$uploader->setFilesDispersion(false);
$uploader->save($path,$fname); //save the file on the specified path