How do I open a local path on my computer, say /home/mypath/Desktop/Projects/projectFolder1/
using an HTML
button on my webpage?
I am trying to do this because I would like to dump a certain amount of .pdf
documents inside the folder.
Below the code that I am using:
import React from 'react';
import { Card, CardImg, CardText, CardBody, CardTitle, CardSubtitle } from 'reactstrap';
import '../components/SideBar.css';
import { Link } from 'react-router-dom';
import example from '../documents/sample.zip';
import example2 from '../documents/example1.pdf';
class AtchafalayaButton extends React.Component {
render() {
return <DownloadLink src={example}>Download Project Specs</DownloadLink>;
}
}
class DownloadLink extends React.Component {
render() {
return (
<form method="get" action={this.props.src}>
<button type="submit" class="btn btn-primary mr-3">
{this.props.children}
</button>
</form>
);
}
}
const Sidebar = () => (
<div className="map-sidebar">
<Card className="mb-2">
<CardImg />
<CardBody>
<CardTitle>
<h3>Title</h3>
</CardTitle>
<CardSubtitle>Title Section</CardSubtitle>
<CardText>
<h6>Project Details</h6>
</CardText>
<div class="btn-toolbar">
<AtchafalayaButton />
</div>
</CardBody>
</Card>
1) I tried the following approach but realized that it was not correct as I am not trying to download
<a href="path_to_file" download="proposed_file_name">
but I am trying to open /home/mypath/Desktop/Projects/projectFolder1/
using an HTML
button on my webpage.
2) Therefore I dug more into the problem and found this source and this one too. However they don't seem to address properly the problem.
3) I stepped back and tried to look at something less advanced but with more explanation on how to do that and found this basic example which sort of helps me but than it nevers explains how to open up or set a local folder.
4) After digging more I came across this other source which makes me a bit concerned as in the same source there is a link to this other source which explain that apparently it is not possible. However that link is almost 5 years old and maybe something else that I am not aware of already exists.
Please point to the right direction as I am running out of ideas and options on how to solve this problem.