Amazon S3 API正在开发中,但尚未投入生产。 我也上传了所有DLL文件和Web配置上的密钥。
我还有其他事要做吗?
这是代码:
var context;
if (typeof AudioContext !== "undefined") {
context = new AudioContext();
} else if (typeof webkitAudioContext !== "undefined") {
context = new webkitAudioContext();
}
var analyser = context.createAnalyser();
analyser.fftSize = 64;
frequencyData = new Uint8Array(analyser.frequencyBinCount);
// Get the frequency data and update the visualisation
function update() {
requestAnimationFrame(update);
analyser.getByteFrequencyData(frequencyData);
};
$(document).ready(function(){
$("#player").bind('canplay', function() {
var source = context.createMediaElementSource(this);
source.connect(analyser);
analyser.connect(context.destination);
});
};
这是一个例外:
Amazon.Util.ProfileManager.RegisterProfile(bucket, key, secret);
using (IAmazonS3 s3Client = new AmazonS3Client(credentials, RegionEndpoint.USEast1))
{
// Setup request for putting an object in S3.
PutObjectRequest request = new PutObjectRequest
{
BucketName = bucketfolder,
Key = key,
InputStream=file,
ContentType = "image/jpeg",
CannedACL=S3CannedACL.PublicRead
};
// Make service call and get back the response.
PutObjectResponse response = s3Client.PutObject(request);
return response.HttpStatusCode;
}