With "simple" REST API, you can do almost anything you can do with the JavaScript API. The REST API does not require any SP.js or other SharePoint JavaScript file. You can consume this REST API from any language, and also from JavaScript (with jQuery to simplify the Ajax calls).
To upload a file, you'll find your happiness here: https://msdn.microsoft.com/en-us/library/office/dn769086.aspx#UploadFile. The _spPageContextInfo
call you'll find in the cde is the only "SP.js" artefact, but it is used only to get the target site URL: you can easily replace it with a hard-coded URL, a user-parameter or build it from the current address.
And here, the REST call example to delete a file: https://msdn.microsoft.com/en-us/library/office/dn292553.aspx#Files.
All CRUD examples using jQuery are here (not an MSDN reference, but still): http://bloggerbrij.blogspot.fr/2015/02/crud-operation-on-files-using-rest.html (credits go to Brijendra Gautam). I copy/paste code from this site for future reference:
UPLOAD A FILE:
this.AddFile = function (arrayBuffer, fileUrl, doSuccess, doError) {
var fileData = '';
var byteArray = new Uint8Array(arrayBuffer);
for (var i = 0; i < byteArray.byteLength; i++) {
fileData += String.fromCharCode(byteArray[i]);
}
// Send the request.
jQuery.ajax({
url: this.SiteUrl + "/_api/web/getfolderbyserverrelativeurl('" + this.FolderUrl + "')/Files/add(overwrite=true, url='" + fileUrl + "')",
method: "POST",
body: fileData,
binaryStringRequestBody: true,
headers: { "accept": "application/json;odata=verbose" },
success: doSuccess,
error: doError
});
}
DELETE A FILE:
this.DeleteFileByServerRelativeUrl = function (FileUrl, doSuccess, doError) {
jQuery.ajax({
url: this.SiteUrl + "/_api/web/getfilebyserverrelativeurl('" + FileUrl + "')",
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
"X-HTTP-Method": "DELETE"
},
success: doSuccess,
error: doError
});
}