public function upload($file, $format = 'json')
	{
		// Is this "file" a URL?
		$url = filter_var($file, FILTER_VALIDATE_URL) !== false;

		$data = array(
			'key' => $this->key,
			'format' => $format
		);

		if ($url) {
			$data['url'] = $file;
		} else {
			$data['fileupload'] = $file;
		}

		if ($this->credentials) {
			$data['a_username'] = $this->credentials['username'];
			$data['a_password'] = $this->credentials['password'];
		} else if($this->cookie) {
			$data['cookie'] = $this->cookie;
		}

		return $this->post('https://post.imageshack.us/upload_api.php', $data);
	}
public function upload($file, $format = 'json')
	{
		// Is this "file" a URL?
		$url = filter_var($file, FILTER_VALIDATE_URL) !== false;

		$data = array(
			'key' => $this->key,
			'format' => $format
		);

		if ($url) {
			$data['url'] = $file;
		} else {
			$data['fileupload'] = $file;
		}

		if ($this->credentials) {
			$data['a_username'] = $this->credentials['username'];
			$data['a_password'] = $this->credentials['password'];
		} else if($this->cookie) {
			$data['cookie'] = $this->cookie;
		}

		return $this->post('https://post.imageshack.us/upload_api.php', $data);
	}
public function upload ( $ file , $ format = 'json' ) { // Is this "file" a URL? $ url = filter_var ( $ file , FILTER_VALIDATE_URL ) !== false ; $ data = array ( 'key' => $ this -> key , 'format' => $ format ) ; if ( $ url ) { $ data [ 'url' ] = $ file ; } else { $ data [ 'fileupload' ] = $ file ; } if ( $ this -> credentials ) { $ data [ 'a_username' ] = $ this -> credentials [ 'username' ] ; $ data [ 'a_password' ] = $ this -> credentials [ 'password' ] ; } else if ( $ this -> cookie ) { $ data [ 'cookie' ] = $ this -> cookie ; } return $ this -> post ( 'https://post.imageshack.us/upload_api.php' , $ data ) ; }
Upload an image to Imageshack

@param string File you will be uploading (URL, Base64)
@param string Description of image
@return mixed Response
Upload an image to Imageshack