我在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