Kan iemand mij uitleggen waarom die $this-> opeens niet kan in createFilename(). Ik krijg steeds:
Fatal error: Using $this when not in object context in /home/***/UploadConverter.class.php on line 63
Ik wil de bestandsnaam daarvan oproepen in getUploadData().
Waar gaat het mis?
Â
Fatal error: Using $this when not in object context in /home/***/UploadConverter.class.php on line 63
Ik wil de bestandsnaam daarvan oproepen in getUploadData().
   public function getUploadHash($hash) {
   $this->uploadhash = $hash;
   return $this->uploadhash;
  Â
   }
  Â
   /* Create Filename, which not exists*/
   private static function createFilename($filename) {
   while (true) {
      $timecreated = time();
      $file = pathinfo($filename);
      $prefix = uniqid();
      $filename_new = $timecreated.'_'.$prefix;
      if (!file_exists($filename_new)) break;
   }
   $this->filename = $filename_new;
   return $filename_new;
   }
public function getUploadData() {
   $filedata['Name'] = $this->filename;
   $filedata['Type'] = '';
   $filedata['UploadID'] = $this->uploadID;
   $filedata['Author'] = '';
   return $filedata;
   }
Opmerkelijk is dat als voorbeeld die    $this->uploadhash = $hash; wel weer mag?Waar gaat het mis?
Â
