RocketChat/Rocket.Chat · error
response.message ? t(response.message) : 'Error uploading fi
Error message
response.message ? t(response.message) : 'Error uploading file'
What it means
Thrown when uploadFileToWebdav returns success:false — the WebDAV server rejected the PUT request (auth failure, wrong path, 4xx/5xx). The thrown message is response.message passed through t() if it matches a translation key, otherwise the literal 'Error uploading file'; the catch turns it into an error toast.
Source
Thrown at apps/meteor/client/views/room/webdav/SaveToWebdavModal.tsx:81
const {
url,
attachment: { title },
} = data;
fileRequest.current = new XMLHttpRequest();
fileRequest.current.open('GET', url, true);
fileRequest.current.responseType = 'arraybuffer';
fileRequest.current.onload = async (): Promise<void> => {
const arrayBuffer = fileRequest.current?.response;
if (arrayBuffer) {
try {
if (!title) {
throw new Error('File name is required');
}
const response = await uploadFileToWebdav(accountId, arrayBuffer, title);
if (!response.success) {
throw new Error(response.message ? t(response.message) : 'Error uploading file');
}
return dispatchToastMessage({ type: 'success', message: t('File_uploaded') });
} catch (error) {
return dispatchToastMessage({ type: 'error', message: error });
} finally {
setIsLoading(false);
onClose();
}
}
};
fileRequest.current.send(null);
};
return (
<Modal wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(handleSaveFile)} {...props} />}>
<ModalHeader>
<ModalTitle>{t('Save_To_Webdav')}</ModalTitle>
<ModalClose title={t('Close')} onClick={onClose} />View on GitHub (pinned to b2c16d5842)
Solutions
- Re-authorize the WebDAV account under Account settings so fresh credentials are stored (the most common fix)
- Verify the WebDAV server URL is reachable from the Rocket.Chat server and the target folder is writable (test with an external WebDAV client)
- Inspect response.message — the WebDAV server's status text — to identify the exact HTTP failure
Defensive patterns
Strategy: try-catch
Validate before calling
const probe = await uploadFileToWebdav(accountId, new ArrayBuffer(0), '.probe');
if (!probe.success) {
/* surface credential/path problem before the real upload */
} Try / catch
try {
const response = await uploadFileToWebdav(accountId, arrayBuffer, title);
if (!response.success) {
// inspect response.message for the WebDAV status text before deciding
dispatchToastMessage({ type: 'error', message: response.message || 'Error uploading file' });
}
} catch (error) {
dispatchToastMessage({ type: 'error', message: error });
} Prevention
- Re-authorize the WebDAV account after any password change
- Verify the WebDAV URL and folder permissions with an independent client before integrating
- Treat success:false as a WebDAV-side failure: log response.message to identify the HTTP status
When it happens
Trigger: Stored WebDAV account credentials are wrong or the password was rotated since authorization; the WebDAV server URL or folder path is incorrect; the server returns 401/403/404/409/507; network/proxy failure between Rocket.Chat and the WebDAV host.
Common situations: Password changed after the account was linked, WebDAV endpoint moved behind a VPN/proxy, target folder permissions revoked, server disk full, self-signed certificate rejected.
Related errors
- File name is required
- Error sending file to apps
- invalid-store
- invalid-file
- File upload is unauthorized to connect on Webdav, please ver
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/7cf2cdba571bae45.
Report an issue: GitHub.