Files
minisrv/zefie_wtvp_minisrv/ServiceVault/wtv-disk/userstore.js
zefie e9c883d85a too much to remember
- rewrote sync system yet again
- more classes
    - WTVShared class for shared functions
    - clientShowAlert class for easy client:showalert urls
- User File Store
    - Can upload with PUT commands in wtv-disk
    - Programmically access files with new functions in WTVClientSessionData
    - TODO: file browser
- other stuff I can't remember
2021-08-10 18:30:59 -04:00

21 lines
836 B
JavaScript

if (request_headers.post_data) {
if (request_headers.query.partialPath) {
if (socket.ssid) {
if (ssid_sessions[socket.ssid]) {
if (ssid_sessions[socket.ssid].isRegistered()) {
var result = ssid_sessions[socket.ssid].storeUserStoreFile(request_headers.query.partialPath, new Buffer.from(request_headers.post_data.toString(CryptoJS.enc.Hex), 'hex'), request_headers.query['last-modified-seconds'] || null, (request_headers.query.no_overwrite) ? false : true);
if (result) {
headers = "200 OK\n";
headers += "Content-Type: text/plain";
}
}
}
}
}
}
if (!headers) {
var errpage = doErrorPage(400)
headers = errpage[0];
data = errpage[1];
}