ASingh
ASingh

Reputation: 485

file.slice is 'undefined' in PhantomJS

I am using phantomjs to upload a file on my web server. Somehow, I am using slice() function in my upload function which phantomjs is not recognizing and throwing 'undefined' exception. However, the same code works pretty well with normal browsers.

Can anybody help me in explaining the reason and any alternative?

Exception:

TypeError: 'undefined' is not a function (evaluating 'file.slice(start, stop + 1)')

Upvotes: 1

Views: 519

Answers (1)

Deblaton Jean-Philippe
Deblaton Jean-Philippe

Reputation: 11398

You should use file.webkitSlice(start, stop + 1);

Slice is not yet fully supported and Phantom is based on webkit.

Upvotes: 1

Related Questions