content = file_get_contents($path); $this->name = pathinfo($path, PATHINFO_BASENAME); $this->ext = pathinfo($path, PATHINFO_EXTENSION); $this->myme = mime_content_type($path); } public function getName(){ return $this->name; } public function getSize(){ return strlen($this->content); } public function getContent(){ return $this->content; } public function getExtension(){ return $this->ext; } public function getBase64(){ // Format the image SRC: data:{mime};base64,{data}; return 'data:'.($this->myme).';base64,'.base64_encode($this->content); } } ?>