0

In my react project, there is a screen where the user can upload a file (excel, csv) from their computer. After uploading, currently, nothing happens. However, I want to print or display whatever text is inside the uploaded on my screen (in any format for now). However, I am not sure how and where I need to store the file for now. How can I achieve this?

This is how I am uploading the file atm:

import Uploady from "@rpldy/uploady"; import UploadButton from "@rpldy/upload-button"; export function Page() { return ( <div> <main> <Uploady destination={{ url: "https://my-server/upload" }}> <UploadButton/> </Uploady> <div> </div> </main> </div> ); } 
1

2 Answers 2

0

you have to use the post function to uplode it in a API ,and then you have to fetch the data from the API and can store the response,you can use axios for this.

Sign up to request clarification or add additional context in comments.

2 Comments

depending on what "uploady" is, you should be able to access the contents of the file even BEFORE uploading FileReader API
This kind of suggestion without code you can add as comment on main question.
0

A similar question has already been answered, you can check it out -> Upload and read a file in react

Comments