[eluser]Vaibhav132[/eluser]
I am working on uploading images functionality.
I am getting following errror
I am getting following error
A PHP Error was encountered
Severity: Warning
Message: scandir() [function.scandir]: Directory name cannot be empty
Filename: models/gallery_model.php
Line Number: 60.
A PHP Error was encountered
Severity: Warning
Message: array_diff() [function.array-diff]: Argument #1 is not an array
Filename: models/gallery_model.php
Line Number: 61
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: models/gallery_model.php
Line Number: 63
I am using get_images() to scan directory images.
This function works exactly the way i want on WINDOWS but not on LINUX
Code:
$this->gallery_path = realpath(APPPATH . '../'.$a);
$this->gallery_path_url = base_url().$a.'/';
$data['images'] = $this->get_images();
Code:
function get_images() {
Line 60:$files = scandir($this->gallery_path);
Line 61:$files = array_diff($files, array('.', '..', 'thumbs'));
$images = array();
Line 63:foreach ($files as $file) {
$images []= array (
'name' => $file,
'url' => $this->gallery_path_url . $file,
'thumb_url' => $this->gallery_path_url . 'thumbs/' . $file
);
}
return $images;
}