I want to upload a file to the server, so that another user can go onto the site, and search up the thing
It's going to take the file from the client, and put it into https://vidimax.elan1012549.repl.co/Videos/ or Videos/
so ANY user can go in and see the video when the html retrieves the file Videos/FILENAME.mp4
<input type="file" id="VIDEO">
<input type="submit" id="submit">
then, on another page, any user can access it with the search bar in
<input type="text" placeholder="Search" autofocus id="SearchBar">
<input type="submit" id="search" value="search" onclick="SetQuery(), GetQuery(), reload()">
<br> <br> <br>
<textarea id="ShowResultsFor"></textarea>
<br><br><br>
<div id="div">
<video src="Videos/" width="1080" height="720" controls id="Result2">
</video>
</div>
let Query;
let Video;
function SetQuery(){
var Search = document.getElementById("SearchBar");
Query = Search.value;
}
function GetQuery(){
document.getElementById("ShowResultsFor").value = ("Results for: " + Query);
Video = (Query + ".mp4");
document.getElementById("Result2").src = ("Videos/" + Video);
console.log(document.getElementById("Result2").src)
}
function reload(){
var container = document.getElementById("div");
var content = container.innerHTML;
container.innerHTML= content;
//this line is to watch the result in console , you can remove it later
console.log("Refreshed");
}
I specifically cannot use PHP because the browser just downloads the .php file, as it does not support php
and I wish for this to work on most browsers
edit: I found a method with python