I am new to magento and i am Creating Custom module for File upload in magento admin.
Right now i have post the upload file in my module controller.
Here i have used move_uploaded_file
to upload file in same directory with in controller folder.
below code i have used for file upload in controller
$file_name=$_FILES["file"]["name"];
$file_path="import/$file_name";
if(move_uploaded_file($_FILES["file"]["tmp_name"],$file_path))
{
// my files not uploading
}
I can't able to upload the file in directory folder.
So what i am doing wrong? or suggest me if using move_uploaded_file
in magento controller is correct way to handle file upload ?
Thanks.