 
 
 <cfif action is "putfile">
-<cfhttp
-    result="put"
-    method="put"
-    url="#d.s3_endpoint#/testing.mctesty/#resource#">
-
-
-<!----
-    <cfhttpparam
-        type="header"
-        name="accessKey"
-        value="#d.s3_accesskey#"
-        />
-	 <cfhttpparam
-        type="header"
-        name="secretKey"
-        value="#d.s3_secretkey#"
-        />
-
-
-    <cfhttpparam
-        type="header"
-        name="x-amz-acl"
-        value="bucket-owner-full-control"
-        />
-
-
-----><cfhttpparam
-        type="header"
-        name="Authorization"
-        value="AWS #d.s3_accesskey#:#signature#"
-/>
-
-
-
-
-    <cfhttpparam
-        type="header"
-        name="Content-Length"
-        value="#contentLength#"
-        />
-
-    <cfhttpparam
-        type="header"
-        name="Content-Length"
-        value="#arrayLen( content )#"
-        />
-
-    <cfhttpparam
-        type="header"
-        name="Content-Type"
-        value="#contentType#"
-        />
-
-    <cfhttpparam
-        type="header"
-        name="Date"
-        value="#currentTime#"
-        />
-
-    <cfhttpparam
-        type="body"
-        value="#content#"
-        />
-</cfhttp>
+	<cfset content = fileReadBinary( expandPath( "/images/Arctos-generic-header.png" ) ) />
+	<cfset bucket="testing.mctesty/subtester">
+	<cfset resource = "Arctos-generic-header.png" />
+	<cfset currentTime = getHttpTimeString( now() ) />
+	<cfset contentType = "image/png" />
+	<cfset contentLength=arrayLen( content )>
+
+	<cfset stringToSignParts = [
+	    "PUT",
+	    "",
+	    contentType,
+	    currentTime,
+	    "/" & bucket & "/" & resource
+	] />
+
+	<cfset stringToSign = arrayToList( stringToSignParts, chr( 10 ) ) />
+
+	<cfset signature = binaryEncode(
+			binaryDecode(
+				hmac( stringToSign, d.s3_secretKey, "HmacSHA1", "utf-8" ),
+				"hex"
+			),
+			"base64"
+		)>
+
+
+	<cfhttp
+	    result="put"
+	    method="put"
+	    url="#d.s3_endpoint#/testing.mctesty/#resource#">
+
+		<cfhttpparam
+	        type="header"
+	        name="Authorization"
+	        value="AWS #d.s3_accesskey#:#signature#"
+		/>
+
+
+
+
+	    <cfhttpparam
+	        type="header"
+	        name="Content-Length"
+	        value="#contentLength#"
+	        />
+
+	    <cfhttpparam
+	        type="header"
+	        name="Content-Length"
+	        value="#arrayLen( content )#"
+	        />
+
+	    <cfhttpparam
+	        type="header"
+	        name="Content-Type"
+	        value="#contentType#"
+	        />
+
+	    <cfhttpparam
+	        type="header"
+	        name="Date"
+	        value="#currentTime#"
+	        />
+
+	    <cfhttpparam
+	        type="body"
+	        value="#content#"
+	        />
+	</cfhttp>
 </cfif>
 
 

    binary file since we aren't posting it like a form field - we're
    posting it as the BODY of the PUT request.
--->
<cfset content = fileReadBinary( expandPath( "/images/Arctos-generic-header.png" ) ) />

<!---
    When uploading the file, we are going to save it at the



<!--- Collapse the parts into a newline-delimited list. --->

<br>stringToSign: #stringToSign#

