Warning: include(./includes/rating_functions.php) [function.include]: failed to open stream: No such file or directory in /home/stree31/public_html/Bartimus/templates/header.tpl.php on line 2

Warning: include(./includes/rating_functions.php) [function.include]: failed to open stream: No such file or directory in /home/stree31/public_html/Bartimus/templates/header.tpl.php on line 2

Warning: include() [function.include]: Failed opening './includes/rating_functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/stree31/public_html/Bartimus/templates/header.tpl.php on line 2
Zwixy - Simple image hosting. Upload pictures without hassle
Zwixy


API Documentation


In order to access the API interface, you must have a working API key. You can get your API key here . To get your API key you must have a premium or free account.

Get file information:

You must pass your API key and the files ID via post or get

Example Get:
http://www.zwixy.com/api/info.php?api_key=1234567890&file_id=1234567890

Output:
Array ( [file_id] => QCRssxD12y0260423 [file_name] => myFile.rar [file_type] => application/octet-stream [file_size] => 1434112, [views] => 126 )


Uploading Files:

The following code is just an example, you can achive the same affect in other programming languages.

Example:
class Uploader { var $filePath; var $uploadURL; var $formFileVariableName; var $postParams = array (); function Uploader($filePath, $uploadURL, $formFileVariableName, $otherParams = false) { $this->filePath = $filePath; $this->uploadURL = $uploadURL; if(is_array($otherParams) && $otherParams != false) { foreach($otherParams as $fieldName => $fieldValue) { $this->postParams[$fieldName] = $fieldValue; } } $this->postParams[$formFileVariableName] = "@" . $filePath; } function UploadFile() { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->uploadURL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postParams); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch); if (curl_errno($ch)) { print curl_error($ch); print "Unable to upload file."; exit(); } curl_close($ch); return $postResult; } } $upload_server = "http://www.zwixy.com/api/upload.php"; $upload = new Uploader('file.rar', $upload_server, 'file', array('api_key' => 'YOUR_API_KEY')); $result = $upload->UploadFile(); if(preg_match("/upload_failed/", $result)){ echo "Upload failed."; } if(preg_match("/invalid_api/", $result)){ echo "Invalid API Code."; } if(preg_match("/upload_success/", $result)){ echo $result; }

Output:
upload_success
http://www.zwixy.com/images/123456789/myimage.jpg
http://www.zwixy.com/delete/123456789/123456789/myimage.jpg



Footer