0

I have a small webpage as example that looks like the one below. I have a certain number of users who can use that application and I would like to have the possibility for the user to upload one or more files to ShareSync on a specific folder.

The order of operation is therefore the following:

Take .pdf from Desktop-> open path using webpage button as shown -> access to ShareSync specific folder -> upload .pdf in that folder

save

Would that be possible?

Below the code I am using for far:

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>

What I have done so far:

1) I consulted file-saver but this does not seem to be what I want because the user has to upload a file into a folder and not download from the folder.

2) I dug into the problem and found this source and this one too. However they don't seem to address properly the problem I have.

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 it is mostly aimed at downloading and not at uploading a file to a specific location.

4) After digging more I came across this other source from which it is not clear if this operation is possible.

Please point to the right direction as I am running out of ideas and options on how to solve this problem.

chazsolo
  • 7,873
  • 1
  • 20
  • 44
Emanuele
  • 2,194
  • 6
  • 32
  • 71
  • What is ShareSync? Maybe it has an API you can use to upload files. Does it have any documentation you could look at (and give us a link to)? From a browser you can only upload files to a remote server via HTTP. You cannot "upload" then to a "local path" (by which I assume you mean a file on the same device as the browser is running on), because a) the browser doesn't have permissions to write to local paths, and b) that's a pretty nonsensical requirement anyway, because the user could just copy the file to that folder in the normal way, without involving a web page. – ADyson Feb 12 '20 at 14:03
  • ShareSync is a [sharing service](https://www.microsoft.com/en-us/p/sharesync/9wzdncrdlbqs?activetab=pivot:overviewtab) where you can create/erase folders. Only subscibed users can access to it. – Emanuele Feb 12 '20 at 14:07
  • Ok. So that links us to the app in a store. Where's the product website? Do they have an API? Do they have documentation? You didn't answer that bit. – ADyson Feb 12 '20 at 14:21
  • Sorry, so [here](https://sharesync.serverdata.net/Downloads/ShareSync/documents/ShareSync%20Get%20Started%20Guide%20for%20Windows.pdf) is the link to the product. As far as I can [see](https://kb.smarshmail.com/Article/3361?query=tag%3d%22ShareSync%22) from the website there is no API available. – Emanuele Feb 12 '20 at 14:50
  • Maybe is there another product I can use instead? – Emanuele Feb 12 '20 at 14:51
  • It sounds very similar to lots of products - OneDrive, Google Drive, Dropbox, etc etc etc. And all of those have APIs. – ADyson Feb 12 '20 at 14:58
  • Thanks I didn't know about Google Drive API! Nice to know and I will use that as it seems more easy and documentation is available! Thanks! – Emanuele Feb 12 '20 at 15:20

0 Answers0