anchor.diff:  		    <cfhttpparam type="header" name="Date" value="#currentTime#" />
   		</cfhttp>
   
  -
   		<cfset tempName=createUUID()>
   		<cffile action="upload"	destination="#Application.sandbox#/" nameConflict="overwrite" fileField="file" mode="600">
   		<cfset fileName=cffile.serverfile>
  
positive.code: 					<cfset msg=cfcatch.message & '; ' & cfcatch.detail>
  				</cfif>
  				<cfset r.msg=msg>
  			<cfcatch>
  				<cfset r.statusCode=400>
  				<cfset r.msg=cfcatch.message & '; ' & cfcatch.detail>
  			</cfcatch>
  			</cftry>
  			---->
  			<cfset r.statusCode=400>
  			<cfset r.msg=cfcatch.message & '; ' & cfcatch.detail>
  		</cfcatch>
  
negative.code: 		] />
  
  		<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#/#bucket#/#fileName#">
  			<cfhttpparam type="header" name="Authorization" value="AWS #d.s3_accesskey#:#signature#"/>
  		    <cfhttpparam type="header" name="Content-Length" value="#contentLength#" />
  		    <cfhttpparam type="header" name="Content-Type" value="#contentType#"/>
  		    <cfhttpparam type="header" name="Date" value="#currentTime#" />
  		    <cfhttpparam type="body" value="#content#" />
  		</cfhttp>
  		<cfset media_uri = "https://web.corral.tacc.utexas.edu/arctos-s3/#bucket#/#fileName#">
  
  		<cfif IsImageFile("#Application.sandbox#/#tempName#.tmp")>
  			<!---- make a thumbnail ---->
  			<cfimage action="info" structname="imagetemp" source="#Application.sandbox#/#tempName#.tmp">
  			<cfset x=min(180/imagetemp.width, 180/imagetemp.height)>
  			<cfset newwidth = x*imagetemp.width>
  	    	<cfset newheight = x*imagetemp.height>
  		    <cfset barefilename=listgetat(filename,1,".")>
  		    <cfset tfilename="tn_#barefilename#.jpg">
  		   	<cfimage action="convert" source="#Application.sandbox#/#tempName#.tmp" width="#newwidth#" height="#newheight#" destination="#Application.sandbox#/#tfilename#" overwrite = "true">
  		   	<cfimage action="resize" source="#Application.sandbox#/#tfilename#" width="#newwidth#" height="#newheight#" destination="#Application.sandbox#/#tfilename#" overwrite = "true">
  		   	<cfset bucket="#session.username#/#dateformat(now(),'YYYY-MM-DD')#/tn">
  			<cfset currentTime = getHttpTimeString( now() ) />
  			<cfset contentType = "image/jpeg" />
  			<cffile variable="content" action = "readBinary"  file="#Application.sandbox#/#tfilename#">
  			<cfset contentLength=arrayLen( content )>
  			<cfset stringToSignParts = [
  			    "PUT",
  			    "",
  			    contentType,
  			    currentTime,
  			    "/" & bucket & "/" & tfilename
  			] />
  			<cfset stringToSign = arrayToList( stringToSignParts, chr( 10 ) ) />
  		<cfset signature = binaryEncode(
  			binaryDecode(
  				hmac( stringToSign, d.s3_secretKey, "HmacSHA1", "utf-8" ),
  				"hex"
  			),
  			"base64"
  		)>
  		<cfhttp result="putTN" method="put" url="#d.s3_endpoint#/#bucket#/#tfilename#">
  			<cfhttpparam type="header" name="Authorization" value="AWS #d.s3_accesskey#:#signature#"/>
  		    <cfhttpparam type="header" name="Content-Length"  value="#contentLength#" />
  		    <cfhttpparam type="header" name="Content-Type"  value="#contentType#" />
  		    <cfhttpparam type="header" name="Date" value="#currentTime#" />
  		    <cfhttpparam type="body" value="#content#" />
  		</cfhttp>
  		<cfset r.preview_uri = "https://web.corral.tacc.utexas.edu/arctos-s3/#bucket#/#tfilename#">
  	<cfelse>
  		<cfset r.preview_uri="">
  	</cfif>
      <cfset r.statusCode=200>
  	<cfset r.filename="#fileName#">
  	<cfset r.mime_type=mimetype>
  	<cfset r.media_uri="#media_uri#">
  
  		<cfcatch>
  			<cftry>
  				<cfset r.statusCode=400>
  				<cfset r.msg=msg>
  				<!----
  				<cfif cfcatch.message contains "already exists">
  					<cfset umpth=#ucase(session.username)# & "/" & #ucase(fileName)#>
  					<cfquery name="fexist" datasource="uam_god">
  