how to upload a file to rickcs server ?

改变自己 1287567042 at qq.com
Wed Jan 21 20:47:11 EST 2015


dear friend 
recently, I installed a rickcs server myself,
then I tried to use the aws s3 interface to upload a file to my rickcs server .

the client side code:
var bucket = new AWS.S3({params: {
Bucket: 'test-bucket',
accessKeyId : 'DVJDPQGX8QG3QLR_T-J2',
secretAccessKey: '6cThOUXOmxHNAlsjyJzE03-Ph2caqIlAiaG7oQ==',
sslEnabled : false,
httpOptions :{proxy :'http://ecs999.eicps.net:8018',xhrWithCredentials :true}
// endpoint:'http://ecs999.eicps.net:8018'
}});
var params = {Key: file.name, ContentType: file.type, Body: file};
bucket.upload(params, function (err, data) {
window.alert("result");
results.innerHTML = err ? 'ERROR!' : 'UPLOADED.';
})

as a result ,i failed, there is no response information from the server and the file is not uploaded to the server !

now I doubt that maybe it is because the limit to The same-origin policy !
so I want to know whether there is a way to confige cors in the server side ,
or orther ways to solve my problem!

if it is the fault of my client side code,please correct me !

the best wishes!‍










comment :

I used the aws s3 javascript interface in the client side !‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20150122/ed3f7723/attachment-0002.html>


More information about the riak-users mailing list