0

I am using a jquery plugin for uploading contents. This plugin use File api. when i use chrome there is an error show that

   Uncaught TypeError: Object #<File> has no method 'webkitSlice'.

here is the error present

    /**
 * Return the proper slice (packet)
 * @param {Number} packetId 
 * @returns {Blob} Returns a new Blob object containing the data in the specified range of bytes
 */
function getPacket(packetId){

    var startByte = packetId  * self.packetSize,
    endByte = startByte+self.packetSize,
    packet;

    if ('mozSlice' in self.file) {
        // mozilla
        packet = self.file.mozSlice(startByte, endByte);
    } else {
        // webkit
        packet = self.file.webkitSlice(startByte, endByte); // here
    }
    return packet;
}

if any one know about this please help me

1
  • give the code snippet that is related to the line number of this exception. Commented Jan 16, 2013 at 3:34

1 Answer 1

1

The method webkitSlice is depracated long time ago and it's not being used anymore for that object. Try slice() instead:

packet = self.file.slice(startByte, endByte);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.