Error when uploading files from a directory....
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 4
- Forks
- 1
- Avg merge
- 13h 32m
- Merged PRs (30d)
- 3
Description
I don't remember how this is supposed to work, but it seems that when I upload files from the "upload" directory, we get the error below. In general we want people to be able to upload photos without getting an error like this.
My file
file.path
UnkonwnElizaSpring.JPG
file.path
Error: child failed: path argument was an invalid path = "/apps/abc/tags/uploads/UnkonwnElizaSpring.JPG". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"
at validatePathString (/Users/robertread/PubInv/pjournal/node_modules/@firebase/database/dist/index.node.cjs.js:11130:15)
at validateRootPathString (/Users/robertread/PubInv/pjournal/node_modules/@firebase/database/dist/index.node.cjs.js:11142:5)
at child (/Users/robertread/PubInv/pjournal/node_modules/@firebase/database/dist/index.node.cjs.js:13102:9)
at ref (/Users/robertread/PubInv/pjournal/node_modules/@firebase/database/dist/index.node.cjs.js:13052:33)
at Database.ref (/Users/robertread/PubInv/pjournal/node_modules/@firebase/database/dist/index.node.cjs.js:15113:28)
at writeTagIntoDB (/Users/robertread/PubInv/pjournal/server.js:114:6)
at /Users/robertread/PubInv/pjournal/server.js:204:5
at Layer.handle [as handle_request] (/Users/robertread/PubInv/pjournal/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/robertread/PubInv/pjournal/node_modules/express/lib/router/route.js:137:13)
at Immediate._onImmediate (/Users/robertread/PubInv/pjournal/node_modules/multer/lib/make-middleware.js:53:37)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in server.js at writeTagIntoDB around line 114, then follow the upload flow around line 204. Reproduce the failure by uploading a photo from the upload directory and inspect the Firebase path value shown in the error. Done means the upload completes without the invalid-path error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, javascript
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100