diff --git a/public/js/submit.js b/public/js/submit.js
index 0eaa90598c8639f91762b310cdf637faf61450f1..65854cf46fc3e36cb20f9b9be0559517bb05a156 100644
--- a/public/js/submit.js
+++ b/public/js/submit.js
@@ -14,6 +14,7 @@ const render = () => {
 
     xhr.send()
 }
+const notificationElement = document.getElementById('notification');
 const title = document.getElementById("assignment_name");
 const description = document.getElementById("description");
 const submitForm = () => {
@@ -23,15 +24,30 @@ const submitForm = () => {
     // Get the file input element
     const fileInput = document.getElementById('file');
 
+    // Checking File Types
+    const allowedFileTypes = ['application/pdf', 'video/mp4'];
+    if (!allowedFileTypes.includes(fileInput.files[0].type)) {
+        notificationElement.classList.add('error');
+        notificationElement.innerHTML = '<i class="fas fa-times-circle"></i> Hanya File MP4 dan PDF yang diperbolehkan!';
+        return false;
+    }
+
+    // Check file size (in bytes)
+    const maxSize = 1024 * 1024; // 1 MB
+    if (fileInput.files[0].size > maxSize) {
+        notificationElement.classList.add('error');
+        notificationElement.innerHTML = '<i class="fas fa-times-circle"></i>Ukuran file maksimal 1MB';
+        return false;
+    }
+
     // Append data to the FormData object
     formData.append("uid", uid);
-    formData.append("file", fileInput.files[0]); // Assuming fileInput is your file input element
+    formData.append("file", fileInput.files[0]);
 
     xhr.open("POST", `http://localhost:5001/api/files/scholarship/${sid}/assignment/${aid}`);
 
     xhr.onload = () => {
         const res = JSON.parse(xhr.response);
-        const notificationElement = document.getElementById('notification');
 
         if (res.status === 'success') {
             notificationElement.classList.add('success');