diff --git a/papaparse.js b/papaparse.js index 618d58d..3b3aa32 100644 --- a/papaparse.js +++ b/papaparse.js @@ -608,6 +608,9 @@ function getFileSize(xhr) { var contentRange = xhr.getResponseHeader('Content-Range'); + if (contentRange === null) { // no content range, then finish! + return -1; + } return parseInt(contentRange.substr(contentRange.lastIndexOf('/') + 1)); } }