{"id":18615010,"url":"https://github.com/andrewjbateman/fullstack-react-node-fileupload","last_synced_at":"2026-04-13T19:31:46.462Z","repository":{"id":43594359,"uuid":"184757010","full_name":"AndrewJBateman/fullstack-react-node-fileupload","owner":"AndrewJBateman","description":":clipboard: App with a React frontend and node/express backend. Uploads image files from frontend UI to backend","archived":false,"fork":false,"pushed_at":"2023-01-03T20:56:16.000Z","size":13995,"stargazers_count":0,"open_issues_count":27,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-24T09:58:35.301Z","etag":null,"topics":["css3","expressjs","file-upload","fullstackreact","html5","nodejs","reactjs","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-03T13:07:29.000Z","updated_at":"2020-10-24T20:00:34.000Z","dependencies_parsed_at":"2023-02-01T10:00:54.817Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/fullstack-react-node-fileupload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/fullstack-react-node-fileupload","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Ffullstack-react-node-fileupload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Ffullstack-react-node-fileupload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Ffullstack-react-node-fileupload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Ffullstack-react-node-fileupload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/fullstack-react-node-fileupload/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Ffullstack-react-node-fileupload/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31768635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css3","expressjs","file-upload","fullstackreact","html5","nodejs","reactjs","tutorial-code"],"created_at":"2024-11-07T03:27:49.317Z","updated_at":"2026-04-13T19:31:46.433Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React File Upload\n\nExpress backend server app to handle file uploads.\nReact frontend.\n\n*** Note: to open web links in a new window use: _ctrl+click on link_**\n\n## Table of contents\n\n* [General info](#general-info)\n* [Screenshots](#screenshots)\n* [Technologies](#technologies)\n* [Setup](#setup)\n* [Features](#features)\n* [Status](#status)\n* [Inspiration](#inspiration)\n* [Contact](#contact)\n\n## General info\n\n* Uploads an image file from the React frontend. This file is fetched by the backend using express.jsm and stored in a files directory in the public folder.\n\n* The frontend uses a [FormData object](https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData) with inputs for the file itself and a file name. The image will be displayed on the frontend.\n\n## Screenshots\n\n![Example screenshot](./img/frontend.png).\n\n## Technologies\n\n* [Node.js v12.3.1](https://nodejs.org/) javascript runtime using the [Chrome V8 engine](https://v8.dev/).\n\n* [React v16.10.2](https://reactjs.org/) Frontend javascript library.\n\n## Frontend Setup\n\n### `npm run start`\n\n* Runs the app in development mode. Open [http://localhost:3000](http://localhost:3000) to view in browser.\n\n* The page will reload if you make edits. You will also see any lint errors in the console.\n\n## Backend Setup\n\n### `nodemon app.js`\n\n* Runs the backend in development mode. Open [http://localhost:8000](http://localhost:3000) to view in browser.\n\n## Code Examples\n\n* extract of Frontend `Main.js` that handles the file upload.\n\n```javascript\n  // function to upload an image. FormData() constructor used to create a new FormData object.  \n  // file will be fetched by the backend server running on port 8000.\n  handleUploadImage(event) {\n    event.preventDefault();\n\n    const data = new FormData();\n    data.append('file', this.uploadInput.files[0]);\n    data.append('filename', this.fileName.value);\n\n    fetch('http://localhost:8000/upload', {\n      method: 'POST',\n      body: data,\n    }).then((response) =\u003e {\n      response.json().then((body) =\u003e {\n        this.setState({ imageURL: `http://localhost:8000/${body.file}` });\n      });\n    });\n  }\n\n```\n\n## Status \u0026 To-Do List\n\n* Status: updated oct 2019. working front-end. When running back-end gives a 404 error message 'file not found'.\n\n* To do: check backend code.\n\n## Inspiration\n\n* [Medium article by Antonio Erdeljac, jan 2018: File upload with Node \u0026 React](https://levelup.gitconnected.com/file-upload-with-node-js-react-js-686e342ad7e7)\n\n* [Signet article (original) by Antonio Erdeljac: File upload with Node \u0026 React](https://www.signet.hr/file-upload-with-node-react/)\n\n## Contact\n\nRepo created by [ABateman](https://www.andrewbateman.org) - feel free to contact me!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Ffullstack-react-node-fileupload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Ffullstack-react-node-fileupload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Ffullstack-react-node-fileupload/lists"}