function send() {
setTimeout(function() {
window.open("mailto:" + document.getElementById('email').value + "?subject=" + document.getElementById('subject').value + "&body=" + document.getElementById('message').value);
}, 320);
}
input {
text-align: center;
border-top: none;
border-right: none;
border-left: none;
height: 10vw;
font-size: 2vw;
width: 100vw;
}
textarea {
text-align: center;
border-top: none;
border-right: none;
border-left: none;
border-radius: 5px;
width: 100vw;
height: 50vh;
font-size: 2vw;
}
button {
border: none;
background-color: white;
position: fixed;
right: 5px;
top: 5px;
transition: transform .5s;
}
input:focus {
outline: none;
color: orange;
border-radius: 3px;
}
textarea:focus {
outline: none;
color: orange;
border-radius: 7px;
}
button:focus {
outline: none;
transform: scale(0);
transform: rotate(360deg);
}
<!DOCTYPE html>
<html>
<head>
<title>Send Email</title>
</head>
<body align=center>
<input id="email" type="email" placeholder="yourfreind@something.somthing"></input><br><br>
<input id="subject" placeholder="Subject"></input><br>
<textarea id="message" placeholder="Message"></textarea><br>
<button id="send" onclick="send()"><img src=https://www.dropbox.com/s/chxcszvnrdjh1zm/send.png?dl=1 width=50px height=50px></img></button>
</body>
</html>
Я бы рекомендовал использовать TransferUtility вместо TransferManager. TransferManager находится на пути устаревания и не имеет всех функций, которые имеет TransferUtility. Вот фрагмент кода, показывающий, как вы можете загрузить файл с помощью шифрования на стороне сервера.
let transferUtility = AWSS3TransferUtility.default()
let uploadExpression = AWSS3TransferUtilityUploadExpression()
uploadExpression.setValue("AES256", forRequestHeader: "x-amz-server-side-encryption")
uploadExpression.progressBlock = {(task, progress) in
print("Upload progress: ", progress.fractionCompleted)
}
let uploadCompletionHandler = { (task: AWSS3TransferUtilityUploadTask, error: Error?) -> Void in
if let error = error {
//Error completing transfer. Handle Error
}
else {
//Successfully uploaded.
......
return nil
}
}
transferUtility.uploadData(
data,
bucket: "bucket",
key: "key",
contentType: "contenttype",
expression: uploadExpression,
completionHandler: uploadCompletionHandler
).continueWith (block: { (task) -> Any? in
if let error = task.error {
//Error initiating transfer. Handle error
}
return nil
})
}
Вот ссылка на дополнительную информацию о том, как использовать TransferUtility - https://docs.aws .amazon.com / aws-mobile / latest / developerguide / how-to-transfer-files-with-transfer-utility.html
uploadExpression.setValue(key, forRequestHeader: "x-amz-server-side-encryption-customer-key")
– Karthikeyan 17 July 2018 в 16:41