Folder path in HTML - javascript

I want to select the folder path in windows Not uploading the files in the folder.
<input type="file" webkitdirectory multiple> this option is upload the selected path files.I don't want this to upload the files in my web application.
I want Html code to select the path in windows

Related

how to upload only excel file and save it to a folder in dev mode

Currently, I don't have a API to send the file, So I need to save the uploaded excel file to the code folder itself.
Code:
<input
hidden
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
type="file"
onChange={(e) => onFileChange(e)}
/>
The above code uploads the file but how do I save it?

load multiple file in node js by express

how to load html file along with css file and javascrip file in node js by express?
when I enter localhost:8080\about, load the about us page that contain html,css and js.
for that in your main express js file, you are going to want to add this line at the top of the file
app.use(express.static(__dirname + '/pathToStaticFiles'));
pathToStaticFiles will be the path to your static file, (usually called assets or public). Then all your html files will read from that directory so if your file path for the css file is ./static/css/style.css the html file will call from ./css/style.css. Hope this helped.

Upload a empty folder with js or jquery

hello there I am building a folder upload system with js and PHP
but I got an issue I'm not able to upload a folder that not contains any files
I use
<input type="file" id="picker" name="files" webkitdirectory multiple>
and for getting the file i use
$('input[type="file"]').on("change", function (e) {
let files = $(this).get(0).files;
console.log(files);
});
if a folder contains any file so I can easily access the folder using
files[i].webkitRelativePath
what is the problem
I'm just getting files that contain webkitRelativePath not getting the folders directly
so I'm not able to get any empty subfolders with this approach
can anyone tell me how to access folders directly without webkitRelativePath or anything else so I can handle empty subfolders

How to bind folder path in to vuetify v-text-box?

How do I set or bind a folder path into a v-text-box filed? I don't want to select all the files inside the directory I only needed the folder path.
I tried this
<input type="file" webkitdirectory directory multiple>
but this is selecting all the files from the directory not returning the directory path?
Please help with this.
That's not what the webkitdirectory/directory attributes are for; they will load all the files inside that folder. Either way, there's no way to adchieve what you want cause browsers JS have no access to the File System.

Javascript link to not exist directory

I want to use my javascript file that is in /js directory but I cannot do it.
My file is at htdocs\ElasticSearch\js but the html file points the file to htdocs\ElasticSearch\js\src\main\scripts which doesn't exist
my HTML file here
html code
I want the HTML file to link to htdocs\ElasticSearch\js

Categories