Skip to content

Commit

Permalink
file upload button
Browse files Browse the repository at this point in the history
  • Loading branch information
nourtawfik04 committed Feb 5, 2024
1 parent 4646100 commit b21a917
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<title>Tubender</title>
</head>
<body>
<div id="root"></div>
<div id="root">
<iframe src="upload_file.html" width="100%" height="150px"></iframe>
</div>
</body>
</html>
29 changes: 29 additions & 0 deletions frontend/public/upload_file.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>File Upload</title>
</head>
<body>

<input type="file" id=" fileInput" accept=".iges, .step" />
<button onclick="handleFileUpload()">Upload</button>

<script>
function handleFileUpload() {
var input = document.getElementById('fileInput');
var file = input.files[0];

if (file) {
console.log('Selected file:', file.name);

// add upload stuff
alert('File selected for upload: ' + file.name);
} else {
alert('No file selected.');
}
}
</script>

<div id="root"></div>
</body>
</html>

0 comments on commit b21a917

Please sign in to comment.