post_id = $this->swiffer_get( "entry_id", "int" ); if( $this->post_id < 1 ) RomhackPlazaFS::invalid_parameter_stop( "entry_id", "GET" ); $this->custom_post_type = $this->swiffer_get( "post_type", "string" ); if( $this->custom_post_type === "" ) RomhackPlazaFS::invalid_parameter_stop( "post_type", "GET" ); $this->file_name = $this->swiffer_get( "filename", "filename" ); if( $this->file_name === "" ) RomhackPlazaFS::invalid_parameter_stop( "filename", "GET" ); $this->is_private = $this->swiffer_get( "is_private", "string" ); if( $this->is_private !== "no" && $this->is_private !== "yes" ) $this->is_private = "no"; $this->is_archived = $this->swiffer_get( "is_archived", "string" ); if( $this->is_archived !== "no" && $this->is_archived !== "yes" ) $this->is_archived = "no"; } protected function process(): void { $flags = 0; if( $this->is_private === "yes" ) $flags |= Data::F_PRIVATE_FILE; else if( $this->is_archived === "yes" ) $flags |= Data::F_ARCHIVED_FILE; $data = Data::setup( $this->custom_post_type, $this->post_id, $this->file_name, $flags ); if( !$data->file_exists() ) RomhackPlazaFS::fatal_stop( 404, "File not found." ); new Log( __class__,$this->file_name, $this->post_id, $this->custom_post_type ); RomhackPlazaFS::success_response( [ 'size' => $data->size() ] ); } }