I created a working clientside upload script for cloudinary. The important part of the upload:
<?php
$cloudName = "...";
$apiKey = "...";
$time = time();
$apiSecret = "...";
$fileName = "...";
?>
<form action="https://api.cloudinary.com/v1_1/<?php echo $cloudName;?>/image/upload" method="post" enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="hidden" name="signature" value="<?php echo sha1('public_id='.$fileName.'×tamp='.$time.$apiSecret);?>" />
<input type="hidden" name="api_key" value="<?php echo $apiKey; ?>"/>
<input type="hidden" name="timestamp" value="<?php echo $time; ?>" />
<input type="hidden" name="public_id" value="<?php echo $fileName; ?>" />
<input type="submit" name="submit" value="Submit">
</form>
Now I want to add a transformation to the upload, so the uploads are transformed before they are stored (to save storage space).
I tried adding the following code (where resize is a transformation I created in my cloudinary account).
<input type="hidden" name="transformation" value="resize" />
But a request with a transformation field results in a 401 unauthorized error. I suppose I have to do something with the signature, but what?