Giter Site home page Giter Site logo

Comments (15)

dr-dimitru avatar dr-dimitru commented on May 22, 2024 2

Sorry for huge delay, this is implemented in v1.5.1. Please, see piping docs

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

Could please explain what do you mean?
Cause video/audio streaming is supported.
And any file upload works like readStream

from meteor-files.

 avatar commented on May 22, 2024
getStreamSomehow().pipe(streamOperation).pipe(Files)

basically, a way to pipe data to the file collection

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

On the client?

from meteor-files.

 avatar commented on May 22, 2024

Yeah

from meteor-files.

 avatar commented on May 22, 2024

Basically, a way to expose that stream, maybe a prepareInsert that returns the writable stream

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

Cold you please leave few use cases here?

from meteor-files.

 avatar commented on May 22, 2024

on-the-fly encryption/media encoding is what i'm looking for

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

@NROL39 This is only place suitable for your requirements: https://github.com/VeliovGroup/Meteor-Files/blob/master/files.coffee#L707 , so we can add additional callback which will has arrayBuffer or Uint8Array as argument, but it will be just small chunk of whole file, are you sure you will be able to encode file by pieces?

Alternatively I can suggest separate modifier function which will take whole file and then return modified version this ready for upload, but will it be efficient?

from meteor-files.

 avatar commented on May 22, 2024

Well, loading a 5GB file to memory and operating on it is not feasible on mobile/laptop/pretty-much-any-non-workstation-grade-computer, being able to pipe the data through a modifier function means you only need to hold the current chunk in memory.

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

@NROL39 this is what exactly I'm talking about. Please, confirm what it is possible to encode file - chunk by chunk, and encoder doesn't need the whole file.

from meteor-files.

 avatar commented on May 22, 2024

it is, i've been using it for a while (although what im currently doing is streaming the file through the encoder then rebuilding the file from data chunks from it)

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

within this package? right?
If so, could you copy-paste here some code for further testing

from meteor-files.

 avatar commented on May 22, 2024

using the filestream module for FileReadStream and FIleWriteStream
and a browserify'd version of node.js' crypto library for encryption

key = 'supersecretkey'
iv = 'supersecretiv'
cryptor = crypto.createCipher('aes-128-cbc', key, iv)
fstream = new FileReadStream(file)
fstream.pipe(cryptor).pipe(streamUploadFunction)

where file is a File object
and streamUploadFunction being a function that accepts UInt8Arrays and processes them for download (what we're missing), for now what i'm doing is piping the chunks to a new File object (basically rebuilding the file in memory

fstream.pipe(cryptor).pipe(new FileWriteStream).on('file',callbackFunction)

from meteor-files.

dr-dimitru avatar dr-dimitru commented on May 22, 2024

As @ghost is removed user, I close this issue

from meteor-files.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.