# Upload file to storj from nodejs (uplink-nodejs)

**URL:** <https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868>\
**Category:** troubleshooting\
**Tags:** uplink-nodejs\
**Created:** [January 19, 2022, 8:01pm UTC](https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868 "2022-01-19T20:01:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbaris](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/barbaris/32/9907_2.png) [@barbaris](https://forum.storj.io/u/barbaris)\
**Post date:** [January 19, 2022, 8:01pm UTC](https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868/1 "2022-01-19T20:01:07Z")

</div>

Hello dear gentlemen and ladies.

I’m following Nodejs tutorial and I’m stuck at Step 8 [Create buffer](https://storj-thirdparty.github.io/uplink-nodejs/#/tutorial?id=create-buffer) section.

- What is `BUFFER_SIZE` variable? Is it `size.file`?
- What is `fileHandle`? If it is the result of calling `project.uploadObject(...)` function (which returns this object `UploadResultStruct { upload: { _handle: 3 } }`) then what do I need to pass as a `fileHandle`? `fileHandle.upload._handle`?
- [this code](https://pastebin.com/6KGmcYGL) throws this error  
 ![image](https://storj-s3.bcdn.literatehosting.net/original/2X/0/00ec77b9c01cff3c79dd2ea6a091a2580f021e22.png)

---

<div class="post-metadata">

**Author:** ![heunland](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/heunland/32/6076_2.png) [@heunland](https://forum.storj.io/u/heunland)\
**Post date:** [January 19, 2022, 8:19pm UTC](https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868/2 "2022-01-19T20:19:14Z")

</div>

Welcome to the forum! We have escalated this issue to our dev team. They will get back to you asap.

---

<div class="post-metadata">

**Author:** ![utropicmedia-karl](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/utropicmedia-karl/32/65_2.png) [@utropicmedia-karl](https://forum.storj.io/u/utropicmedia-karl)\
**Post date:** [January 19, 2022, 8:28pm UTC](https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868/3 "2022-01-19T20:28:00Z")

</div>

Hi @barbaris !

- Buffersize is temporary memory storage to hold what you decide to read into it. Note it should be at least the same size as the file you are reading/writing
- fileHandle is the filesystem handle (file descriptor) of the file from the filesystem. Check-out [uplink-nodejs/HelloStorj.js at 7fb4a9ab35b04c7338d503d6d3d76d9264c53867 · storj-thirdparty/uplink-nodejs · GitHub](https://github.com/storj-thirdparty/uplink-nodejs/blob/7fb4a9ab35b04c7338d503d6d3d76d9264c53867/HelloStorj.js#L140) for an example
- Look like the error is do to reading a file that either doesn’t exist(permisions, etc.) or seeking off the end of the file.

Check out [uplink-nodejs/HelloStorj.js at 7fb4a9ab35b04c7338d503d6d3d76d9264c53867 · storj-thirdparty/uplink-nodejs · GitHub](https://github.com/storj-thirdparty/uplink-nodejs/blob/7fb4a9ab35b04c7338d503d6d3d76d9264c53867/HelloStorj.js) and see if you can replicate the error with the example code.

Thanks.

-K

---

<div class="post-metadata">

**Author:** ![barbaris](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/barbaris/32/9907_2.png) [@barbaris](https://forum.storj.io/u/barbaris)\
**Post date:** [January 19, 2022, 8:38pm UTC](https://forum.storj.io/t/upload-file-to-storj-from-nodejs-uplink-nodejs/16868/4 "2022-01-19T20:38:04Z")

</div>

Copied line 138 function call body, the error is gone.  
Can’t find uploaded file in my bucket though (on the website). Will leave that for tomorrow.

Thank you so much for quick response

upd. couldn’t find the file because I didn’t commit it to storj.
