BryceStevenWilley / visioning_texts

A D3 project that locally visualizes your messages from Signal or Whatsapp
GNU General Public License v3.0
37 stars 6 forks source link

Unable to read CSV from Signal backup #4

Closed zaynesember closed 4 years ago

zaynesember commented 4 years ago

Followed your instructions for Windows and upon feeding it the CSV I got this error dialog (running locally not on your site): image

BryceStevenWilley commented 4 years ago

Weird, it should only reading the file extension to throw that error window. Are you uploading the CSV itself, or are you uploading the signal backup file?

zaynesember commented 4 years ago

Weird, it should only reading the file extension to throw that error window. Are you uploading the CSV itself, or are you uploading the signal backup file?

I'm uploading the CSV made from the tool you recommend on your site, maybe it's some sort of issue with the CSV encoding?

BryceStevenWilley commented 4 years ago

Likely is, yeah. I'm currently just getting the type from JS's FileReader (https://developer.mozilla.org/en-US/docs/Web/API/Blob/type). I'll come up with a better check, might ask you to try to upload again to get some better debugging info.

zaynesember commented 4 years ago

Alright cool, just lmk.

Zleox commented 4 years ago

When uploading a CSV file from Windows, the MIME type is set as 'application/vnd.ms-excel'. The app is only expecting 'text/plain' or 'text/csv'.

zaynesember commented 4 years ago

So I tried to get around this by copying the text of the csv on my Windows machine and then making the actual CSV on Linux but I'm still getting the same error

BryceStevenWilley commented 4 years ago

@Zleox that's a great insight, thanks for that info. I had no clue that MIME types would differ from OS to OS. And unfortunate, @zaynesember. I'll ping you when I have the new debug output in.

BryceStevenWilley commented 4 years ago

@zaynesember I pushed the fix that Zleox mentioned, and also should provide the type of file that the browser is reading your data as. Let me know what it is when you get a chance.

BryceStevenWilley commented 4 years ago

This should be fixed, gonna close.