Exemplo n.º 1
0
 protected function get_file_object($file_name)
 {
     if ($this->is_valid_file_object($file_name)) {
         $file = new stdClass();
         $file->name = $file_name;
         /*$file->size = $this->get_file_size(
               $this->get_upload_path($file_name)
           );*/
         $file->url = $this->get_download_url($file->name);
         foreach ($this->options['image_versions'] as $version => $options) {
             if (!empty($version)) {
                 if (is_file($this->get_upload_path($file_name, $version))) {
                     $file->{$version . 'Url'} = $this->get_download_url($file->name, $version);
                 }
             }
         }
         $this->set_additional_file_properties($file);
         $file->path = $this->get_upload_path($file->name);
         OnGetFileObject($file);
         return $file;
     }
     return null;
 }
Exemplo n.º 2
0
function OnFileUploaded($file)
{
    AddFileToDatabase($file);
    OnGetFileObject($file);
    if (isset($file->vt_submit) && $file->vt_submit == True) {
        ScanFileOnVirusTotal($file);
    }
    if (isset($file->cuckoo_submit) && $file->cuckoo_submit == True) {
        ScanFileOnCuckoo($file);
    }
}