Skip to main content
14-Alexandrite
January 13, 2025
Solved

File Upload Widget - Data can be seen when uploaded.

  • January 13, 2025
  • 1 reply
  • 994 views

I want to display the data when I upload it through File Upload Widget.

For Example - If I upload a csv file using File Upload Widget, then the uploaded csv file content data should be visible to us.

Best answer by nmutter

after user uploaded the file you would need to use service LoadText of the FileRepository, to get the content of the uploaded file. And display the content how you like in the mashup. Looks like currently you show the filepath in your textarea on the right. There you would need to adapt the binding to show result of LoadText service.

 

For csv files a CSV Parser exists which you maybe could use to display the csv in a grid. I'm not 100% clear if this works for any .csv (with unknown columns) as I only used it with known columns, as csvparser needs a DataShape to parse the csv into.

 

1 reply

19-Tanzanite
January 13, 2025

Hi @Abhishek_Tirkey ,

Let's split this requirement in 2 parts:

  1. You want to see data from a file - for that you can use the TextArea widget for human readable formats like CSV.
  2. You'd need to upload it - for that you can use the FileUploader widget. That will provide a property called FullPaths, that you can use in order to supply the input to the service that loads data in the TextArea widget, after you selected a file for upload.
14-Alexandrite
January 13, 2025

Abhishek_Tirkey_0-1736769327740.png 

 

I have taken a File Upload Widget and uploaded a currency.csv file.

But could not able to see the content present inside the csv file.

I am not clear with the bindings and services required for this.

 

 

nmutter16-PearlAnswer
16-Pearl
January 14, 2025

after user uploaded the file you would need to use service LoadText of the FileRepository, to get the content of the uploaded file. And display the content how you like in the mashup. Looks like currently you show the filepath in your textarea on the right. There you would need to adapt the binding to show result of LoadText service.

 

For csv files a CSV Parser exists which you maybe could use to display the csv in a grid. I'm not 100% clear if this works for any .csv (with unknown columns) as I only used it with known columns, as csvparser needs a DataShape to parse the csv into.