mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-23 06:47:30 +00:00
# Features - File drag and drop upload: Support uploading files and folders via drag and drop - Binary file handling: Detect binary files and display a friendly message instead of trying to edit them - Folder download: Download folders as ZIP files (using JSZip library) - Context menu integration: Full right-click context menu for file operations (rename, delete, copy path, download, new file/folder)
23 lines
754 B
TypeScript
23 lines
754 B
TypeScript
// Binary file extensions (images are handled by ImageViewer, not here)
|
|
const BINARY_EXTENSIONS = [
|
|
// Archives
|
|
'zip', 'tar', 'gz', 'rar', '7z', 'bz2', 'xz',
|
|
// Executables
|
|
'exe', 'dll', 'so', 'dylib', 'app', 'dmg', 'msi',
|
|
// Media
|
|
'mp3', 'mp4', 'wav', 'avi', 'mov', 'mkv', 'flv', 'wmv', 'm4a', 'ogg',
|
|
// Documents
|
|
'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'odt', 'ods', 'odp',
|
|
// Fonts
|
|
'ttf', 'otf', 'woff', 'woff2', 'eot',
|
|
// Database
|
|
'db', 'sqlite', 'sqlite3',
|
|
// Other binary
|
|
'bin', 'dat', 'iso', 'img', 'class', 'jar', 'war', 'pyc', 'pyo'
|
|
];
|
|
|
|
export const isBinaryFile = (filename: string): boolean => {
|
|
const ext = filename.split('.').pop()?.toLowerCase();
|
|
return BINARY_EXTENSIONS.includes(ext ?? '');
|
|
};
|