Max file upload 500MB
This commit is contained in:
@@ -1072,7 +1072,8 @@ const ChatArea = ({ channelId, channelName, channelType, username, channelKey, u
|
||||
setInput(inputDivRef.current.textContent);
|
||||
};
|
||||
|
||||
const processFile = (file) => { setPendingFiles(prev => [...prev, file]); };
|
||||
const MAX_ATTACHMENT_SIZE = 500 * 1024 * 1024; // 500MB
|
||||
const processFile = (file) => { if (file.size > MAX_ATTACHMENT_SIZE) { alert('File must be under 500MB'); return; } setPendingFiles(prev => [...prev, file]); };
|
||||
const handleFileSelect = (e) => { if (e.target.files && e.target.files.length > 0) Array.from(e.target.files).forEach(processFile); };
|
||||
const isExternalFileDrag = (e) => {
|
||||
const types = Array.from(e.dataTransfer.types);
|
||||
@@ -1095,7 +1096,7 @@ const ChatArea = ({ channelId, channelName, channelType, username, channelKey, u
|
||||
const uploadRes = await fetch(uploadUrl, { method: 'POST', headers: { 'Content-Type': blob.type }, body: blob });
|
||||
const { storageId } = await uploadRes.json();
|
||||
|
||||
const fileUrl = await convex.query(api.files.getFileUrl, { storageId });
|
||||
const fileUrl = await convex.mutation(api.files.validateUpload, { storageId });
|
||||
|
||||
const metadata = {
|
||||
type: 'attachment',
|
||||
|
||||
Reference in New Issue
Block a user