a simple code to upload files to a NodeJS server
POST /api/upload/single
The file key in the formdata file
Params dir
and subdir
for the main directory and subdirectory, example: dir: "user", subdir: "blog_images"
POST /api/upload/bulk
The file key in the formdata file
DELETE /api/image
Params path
of the file uploaded
Params dir
and subdir
for the main directory and subdirectory, example: dir: "user", subdir: "blog_images"
1- Set the property x-dataupload-key
in the request header
carrying the API key value
2- Set API_KEY
as an environment variable in the backend with the same value as the one sent from the frontend