How to extract file from read_stream in uploadPart function (req object)

I am trying to extract the file from the request object (readStream) to send the file to BTFS (aws-sdk(v4))
in the upload_part function kindly guide me how I can get the file from the read_stream param as the param itself is not a buffer nor file and aws-sdk v4 needs a file in body.

Hi, this is a XY problem. What are you trying to do? Why? What packages are you using?

Sorry for the misguidance,

  • I am using tus node server to send files to BTFS(Bittorrent file system node) using aws-sdk(v4) which is supported by BTFS
    *When I pass the request as body to the uploadPart function I get an error that only Files are supported.
    *I am only using the aws-sdk package for this purpose
  • I am doing this so I can store Files on BTFS through tuss server and aws-sdk

Unfortunately I know nothing about BTFS and we don’t officially support it. It’s still not clear what packages you are using (@tus/s3-store?) or whether you are creating your own store.

If you are using @tus/s3-store then it might be that BTFS doesn’t have full S3 compatibility, which may be the problem.

I am using @tus/s3-store and unfortunately BTFS doesn’t have full S3 compatibility but BTFS does support all the main features and functions which we are using in tuss so that is not a problem

Looking at the list of S3 operations that are supported by BTFS, I think only ListParts is missing. Reimplementing a storage for that is quite a big task.

I have successfully reimplemented a solution for lisparts so that’s not a problem right now. @marius

Also guys I’m sorry I forgot to mention I am using tus-node-server version 0.3.2 as I am on a very old code base that is connected with the tus-server. The solution I think to my problem which I described above is that I just need to extract the file from the req object(read_stream) any help would be greatly appreciated we can also arrange a meeting if that is possible for you guys that would be very helpful.
Looking forward for a positive response.

Just to be clear: you are using open source software for free. That means you’re entitled to nothing and the least users of free OSS can do is spent time on creating quality questions so you can be helped meaningfully and without wasting time. Instead you create a question without any information or context, after asking for more information you still don’t provide it, only mentioning you’re doing something we don’t officially support (normally means you’re on your own).

After a lot of unnecessary back and forth’s you reveal you’re on an ancient, deprecated version (important information to disclose from the start). Now you expect a meeting for free?

I hope you understand that this is not how things are supposed to go.

My recommendations:

  • Inform yourself on asking quality questions.
  • Inform yourself on compatibility of BTFS and whether tus makes sense for this at all
  • If so, upgrade to latest @tus/server and @tus/s3-store
  • Be aware that help can usually only be giving for things we officially support. If you start doing custom things, extend our stores in unanticipated ways, then it’s likely we can’t help.
  • Read “Commercial Support on self-hosted Uppy or Tus” if you want meetings.

thank you for your recommendations but this is an open forum and I can ask questions and discuss my problems with others if you think that my questions are not valid you shouldn’t have even engaged in the conversation as this is an OSS. Anyway, I never asked for anything for free and I never said that I was entitled to anything that’s why I requested information and did not order it. It would help if you also inform yourself on how to stop assuming things based on your sole intellect and try to think of other possibilities.
My recommendations: