Hi again. Because nobody answer me I suppose that is a little bit difficult. I searched all day long about this problem and in the final I found something (thanks to msdn portal and forum). I succeded to make it work and I post my solutin right here. I also found that the javascript library WL dows not support directly to create a file in the onedrve account but REST services does so I just used REST services with AJAX. (I don't know if is the best solution but for me it's working).
function create_docx()
{
WL.login({
scope: ["wl.signin", "wl.basic", "wl.skydrive", "wl.skydrive_update"]
}).then(
function (response) {
$.ajax({
type: 'POST',
contentType: "multipart/form-data; boundary=A300x",
processData: false,
url: 'https://apis.live.net/v5.0/me/skydrive/files?access_token=' + response.session.access_token,
data: createUploadRequestBody(),
success: function () { alert('Success!'); },
error: function () { alert(response.error_description); },
});
});
}
function createUploadRequestBody() {
var body = "--A300x\r\n"
+ "Content-Disposition: form-data; name=\"file\"; filename=\"csm.docx\"\r\n"
+ "Content-Type: application/octet-stream\r\n"
+ "\r\n"
+ "This is some content\r\n"
+ "\r\n"
+ "--A300x--\r\n";
return body;
}