public function set_restrictions(array $restrictions) {
		$this->restrictions = array();

		foreach ($restrictions as $k => $v) {
			switch ($k) {
				case 'maxsize':
					if (is_int($v)) {
						$this->restrictions['maxsize'] = $v;
					}
					break;

				case 'mediatype':
					if (is_array($v)) {
						$this->restrictions['mediatype'] = $v;
					}
					break;

				case 'mimetype':
					if (is_array($v)) {
						$this->restrictions['mimetype'] = $v;
					}
					break;

				case 'extension':
					if (is_array($v)) {
						$this->restrictions['extension'] = $v;
					}
					break;
			}
		}
		return true;
	}