Code Practices about a File Server creation, sending and receiving files via Node.js + React +TypeScript + Express web framework


Hello,

I would like to share sample codes for a file server and some samples how to send and receive JSON files by utilizing Node.js + React Native + Typescript + Express Web framework.

you can download the codes and take them as a sample where you want to use.

File Server codes are in following link:

https://github.com/TheMaty/fileserver 


It utilizes Express Web Framework for Node.js. 

All dependent modules are already defined in my github repository so Once you download it, you will be able to run with npm start immediately. Service is going to settle to default port 8000 .

File Server is configured for sending and receiving for JSON formated files However, you can also manipulate codes for any type of file. 

Call can be done as below:

http://<server name>:8000/api/download?filename=<file name>.json
           
There is a code sample regarding file retrieval in the following link:

It fetches json object from file server then binds JSON objects to a table through Interface with TypeScript . JSON object is kept in useState.

File Server also services storing JSON files in a directory to be retrieved later on.
http://<server name8000/api/upload

File Server pushes JSON file to "./uploads" folder 

Here is the sample code; how you post any files through XMLHttpRequest with POST message.


enjoy !

Comments

Popular posts from this blog

Complex Query in QueryExpression in Microsoft CRM 2011

Exception caught instantiating TERADATA report server extension SQL Reporting Services

Microsoft Power Apps Portal integration with Dynamics 365 CE On-Premise - Step By Step Guide