Skip to content

casper.getFile

Vsevolod Trofimov edited this page Jul 5, 2018 · 2 revisions
casper.getFile(uuid)

Downloads the file from casper network, stores it in memory.

Parameters

  1. String — uuid returned by casper.save.

Returns

Node

CasperPromise that resolves with file's content as a Buffer.

Browser

CasperPromise that resolves with file's content as a Blob.

Example

casper.getFile(uuid)
      .on('progress', done => console.log('download progress', done))
      .then(data => { /* do something with the downloaded file */ })

See CasperPromise & Events for more detailed explanation on .on and CasperPromise.

More examples

Clone this wiki locally