Solved \XF\Http\Upload sometimes return false on images

  • Thread starter RisteDimitrievski
  • Start date
This topic has been solved
R

RisteDimitrievski

Guest
PHP:

Code:
public function getUploadedFilePath(\XF\Http\Upload $filename)
   {
       if($filename->isImage())
       {
           $visitor = XF::visitor();
           $fname = $filename->getFileName();
           $data = "data/{$visitor->user_id}/{$fname}";
           return $data;
       }
   }
public function validateFile(\XF\Http\Upload $fileName)
   {
       if($fileName instanceof XF\Http\Upload)
       {
           $fileName->setAllowedExtensions(['jpg','png','jpeg'])...

Read more

Continue reading...