Skip to content

Commit 87b4cff

Browse files
file upload message code changes commit
1 parent 9a90a6b commit 87b4cff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/frontend/src/components/uploadButton.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
4040
onFileReject,
4141
onUploadStateChange,
4242
maxSize = 200 * 1024 * 1024,
43-
acceptedFileTypes = { 'application/sql': ['.sql'] },
43+
acceptedFileTypes = ['.sql'], // Accept only .sql files
4444
selectedCurrentLanguage,
4545
selectedTargetLanguage
4646
}) => {
@@ -194,9 +194,9 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
194194
fileRejections.forEach(rejection => {
195195
rejection.errors.forEach(err => {
196196
if (err.code === "file-too-large") {
197-
errors.push(`File '${rejection.file.name}' exceeds the 200MB size limit.`);
197+
errors.push(`File '${rejection.file.name}' exceeds the 200MB size limit. Please upload a file smaller than 200MB.`);
198198
} else if (err.code === "file-invalid-type") {
199-
errors.push(`File '${rejection.file.name}' is not a valid SQL file.`);
199+
errors.push(`File '${rejection.file.name}' is not a valid SQL file. Only .sql files are allowed.`);
200200
} else {
201201
errors.push(`File '${rejection.file.name}': ${err.message}`);
202202
}
@@ -213,7 +213,7 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
213213
onDrop,
214214
noClick: true,
215215
maxSize,
216-
accept: acceptedFileTypes,
216+
accept: acceptedFileTypes, // Only .sql files
217217
//maxFiles: MAX_FILES,
218218
};
219219

0 commit comments

Comments
 (0)