mholt / PapaParse

Fast and powerful CSV (delimited text) parser that gracefully handles large files and malformed input
http://PapaParse.com
MIT License
12.42k stars 1.14k forks source link

Papaparse in Cordova (Android , iOS) #766

Open mirko77 opened 4 years ago

mirko77 commented 4 years ago

Hi All,

320 is still an issue in both Android and iOS

xhr.status returns 0 in Android 9, the proposed solution works.

pokoli commented 4 years ago

Which is the proposed solution? Does it make sense to include it as part of PapaParse? If yes, could you please submit a PR?

mirko77 commented 4 years ago

320 offers a solution:


So i changed in the papaparse _chunkLoaded function, this line
if (xhr.status < 200 || xhr.status >= 400)
by this one:
if (!((xhr.status >= 200 && xhr.status < 300) || (xhr.status==0 && xhr.responseText.length>0)))

Without that, parsing currently fails on both Android and iOS

pokoli commented 4 years ago

Could you please add a PR with a comment explaining the reasoning? I will be happy to merge it.

mirko77 commented 4 years ago

I'll do it soon, thanks