{"record":{"id":"7cf2cdba571bae45","repo":"RocketChat/Rocket.Chat","slug":"response-message-t-response-message-error-up","errorCode":null,"errorMessage":"response.message ? t(response.message) : 'Error uploading file'","messagePattern":"response\\.message \\? t\\(response\\.message\\) : 'Error uploading file'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/meteor/client/views/room/webdav/SaveToWebdavModal.tsx","lineNumber":81,"sourceCode":"\n\t\tconst {\n\t\t\turl,\n\t\t\tattachment: { title },\n\t\t} = data;\n\n\t\tfileRequest.current = new XMLHttpRequest();\n\t\tfileRequest.current.open('GET', url, true);\n\t\tfileRequest.current.responseType = 'arraybuffer';\n\t\tfileRequest.current.onload = async (): Promise<void> => {\n\t\t\tconst arrayBuffer = fileRequest.current?.response;\n\t\t\tif (arrayBuffer) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!title) {\n\t\t\t\t\t\tthrow new Error('File name is required');\n\t\t\t\t\t}\n\t\t\t\t\tconst response = await uploadFileToWebdav(accountId, arrayBuffer, title);\n\t\t\t\t\tif (!response.success) {\n\t\t\t\t\t\tthrow new Error(response.message ? t(response.message) : 'Error uploading file');\n\t\t\t\t\t}\n\t\t\t\t\treturn dispatchToastMessage({ type: 'success', message: t('File_uploaded') });\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn dispatchToastMessage({ type: 'error', message: error });\n\t\t\t\t} finally {\n\t\t\t\t\tsetIsLoading(false);\n\t\t\t\t\tonClose();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tfileRequest.current.send(null);\n\t};\n\n\treturn (\n\t\t<Modal wrapperFunction={(props) => <Box is='form' onSubmit={handleSubmit(handleSaveFile)} {...props} />}>\n\t\t\t<ModalHeader>\n\t\t\t\t<ModalTitle>{t('Save_To_Webdav')}</ModalTitle>\n\t\t\t\t<ModalClose title={t('Close')} onClick={onClose} />","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/client/views/room/webdav/SaveToWebdavModal.tsx#L63-L99","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const probe = await uploadFileToWebdav(accountId, new ArrayBuffer(0), '.probe');\nif (!probe.success) {\n\t/* surface credential/path problem before the real upload */\n}","typeGuard":null,"tryCatchPattern":"try {\n\tconst response = await uploadFileToWebdav(accountId, arrayBuffer, title);\n\tif (!response.success) {\n\t\t// inspect response.message for the WebDAV status text before deciding\n\t\tdispatchToastMessage({ type: 'error', message: response.message || 'Error uploading file' });\n\t}\n} catch (error) {\n\tdispatchToastMessage({ type: 'error', message: error });\n}","preventionTips":["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"],"tags":["rocket-chat","webdav","file-upload","external-storage"],"backgroundTag":"file-upload-failed","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}