---
number: 4703
title: File upload
author: ExtAnimal
state: CLOSED
createdAt: '2023-08-11T16:09:19Z'
updatedAt: '2023-08-16T07:42:00Z'
closedAt: '2023-08-15T07:49:07Z'
mergedAt: null
head: file-upload
base: dev
url: 'https://github.com/neomjs/neo/pull/4703'
---


## Comments

### `@tobiu` commented on 2023-08-11T20:21:38Z

Hi Nige,

looks very nice so far. The only thing I am wondering about: do we really want to push the `cors` dependency into the repo? Not really needed there. Also, the `app.js` file on top level. Guess we could move that one into the example folder and maybe rename it into server (with a comment that it requires express & cors). Thoughts?

---

### `@ExtAnimal` commented on 2023-08-13T14:40:55Z

That's why this is a Draft PR. I'm not suggesting that stuff be kept in.

It's for discussion and the sharing of code at this stage.

We will have to work out a testing strategy separately. The sequences of interactions and the states  cycled through are complex, so it will need a test, and that will need some HTTP server which will produce known results in a similar way to that little Express server.

This is the example page, which by going to server endpoints with known responses, exercises all the states. The example may finish with the four possible stable states when a file is selected in each one.

- Successful upload and scan and downloadable
- Successful upload and scan and not downloadable
- Failed upload
- Failed malware scan

From these states, clicking that action icon will reset the widget to its `ready` state.

<img width="490" alt="Screenshot 2023-08-13 at 16 36 44" src="https://github.com/neomjs/neo/assets/200516/8a538e30-1529-46ee-a43c-112ba1c7d706">


---

### `@tobiu` commented on 2023-08-15T07:49:07Z

closing the draft PR & creating a real one

---

