Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
let users download data not working - filesaver not working?

I'm trying to let my users download data through a react button.

I've tried using filesaver, as example below.

const saveFile = () => {
fileSaver.saveAs(
  process.env.REACT_APP_CLIENT_URL + "/resources/cv.pdf",
  "MyCV.pdf"
); };

<button className="cv" onClick={saveFile}>
    Download File
</button>

With my application, I have data in json that is stored in the client that I want to return as a json object, the component looks like this

export default function Analytics() {
  const {
    magicData,
    swordData,

    ....
  } = useAnalytics();
  // console.log(sentimentData)
  return (
    <div className="relative">
      ......
        <button className="shadow-md fixed right-20 bottom-20 z-10 focus:outline-none focus:ring-4 focus:ring-blue-500 focus:ring-opacity-50 rounded-full px-5 text-white py-2 bg-blue-500"
        
        >
          Export Data <BiEdit className="inline" />
        </button>
    </div>
  );
}

How would I go about taking magic and sword data and returning it to the user in a JSON file? There isn't clear instructions I can find on taking client-side data, or fetched data for that matter.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!