kinlane
3/15/2011 - 4:22 AM

POST a file to the Mimeo Cloud Print Storage Service

POST a file to the Mimeo Cloud Print Storage Service

<?php

require_once "rest_client.php";

if(isset($_POST['imgupload']))
	{

	$fileName = $_FILES['uploadFile']['name'];
	$fileTempName = $_FILES['uploadFile']['tmp_name'];
	
	//echo $fileName . "<br />";
	//echo $fileTempName . "<br />";
	
	$root_url = "connect.sandbox.mimeo.com/2010/09/";
	$user_name = "[mimeo account user name]";
	$password = "[mimeo account password]";
	
	$rest = new RESTclient($root_url,$user_name,$password);
	$url = "StorageService/[folder name]/";
	$rest->createRequest($url,"POST",$_POST,$_FILES);
	$rest->sendRequest();
	$StorageResponse = $rest->getResponseBody();
	
	//echo $StorageResponse;
	
	}		
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Storage Post File</title>
</head>
<body>

<form action="storage-post.php" method="post" name="imageForm" id="imageForm" enctype="multipart/form-data">			
   <table width="300" border="1" cellpadding="4" cellspacing="1">
	<tbody>
		<tr>			
			<td align="center">
				<input name="uploadFile" type="file" width="30" />
			</td>
			<td align="center" width="50">
				<input type="submit" class="adminbutton" name="imgupload" value="Upload Image">
			</td>				
		</tr>
	</tbody>
	</table>
</form>
	
</body>
</html>