Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
executor.executeAsync({
url: "<app web url>/_api/SP.AppContextSite(@target)/web
/getfilebyserverrelativeurl('/Shared Documents/filename.docx')
/savebinarystream
?@target='<host web url>'",
method: "POST",
body: "This is the new content.",
success: successHandler,
error: errorHandler
});
It creates a file from the file system to your sharepoint online site. Kindly validate if this is the needed answer.