You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 14, 2019. It is now read-only.
Philipp edited this page Mar 1, 2015
·
2 revisions
// You must have a ReadStream with some data; it can be any stream.// We're using the standard output from a command as an example.varreadStream=spawn('ls',[]).stdout;// Create the FS.File instancevarnewFile=newFS.File();// Attach the ReadStream data to it. You must tell it what the content type is.newFile.attachData(readStream,{type: 'text/plain'});// Optionally provide a file namenewFile.name('ls_result.txt');// Insert the file, which will save the metadata and// store the stream data into all defined stores.// `Files` is an `FS.Collection` instance defined elsewhere.Files.insert(newFile);