owncloud / owncloud-sdk

:cloud: ownCloud client library for JavaScript
https://owncloud.dev/owncloud-sdk/
MIT License
75 stars 33 forks source link

putFile header X-OC-MTime header must be an integer #1180

Open devdynam0507 opened 1 year ago

devdynam0507 commented 1 year ago

I ran the putFile function, but it seems that the wrong value is entered in X-OC-MTime. so i changed return value info.mtime to info.mtimeMs in helperFunctions#_getMTime it's works

/**
 * gets the MTime of a file/folder
 * @param   {string}    path    path of the file/folder
 * @returns {Date}              MTime
 */
helpers.prototype._getMTime = function(path) {
    var info = fs.statSync(path);
    return info.mtimeMs;
};

error logs

node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^
X-OC-MTime header must be an integer (unix timestamp).
(Use `node --trace-uncaught ...` to show where the exception was thrown)
alinamagasumova commented 6 months ago

wht's with last modified date then? i did the same, but now i have an issue that my file was last modified in 11.05.2446. did you do something with it?

image image