rawgraphs / rawgraphs-app

A web interface to create custom vector-based visualizations on top of RAWGraphs core
https://rawgraphs.io
Apache License 2.0
8.66k stars 1.84k forks source link

Files won't upload (apart from Excel) #136

Closed BobHarper1 closed 3 years ago

BobHarper1 commented 7 years ago

Uploading files allows me to select a file, but no data uploaded. Tried for CSV and JSON, and drag-and-drop has no effect.

Excel files, strangely, do upload for me.

Attempted in both Chrome and IE, same results.

Shoklan commented 7 years ago

I'm actually having the same issue. Trying to upload just a .CSV and according to the console it says: code 404, message File Not Found

I thought it might be due to privilages but running via sudo doesn't change anything.

mikima commented 7 years ago

Some more testing on this issue.

Mozilla Firefox 53.0.2 (32 bit) :

Error: file is null
$scope.uploadFile@http://app.rawgraphs.io/js/controllers.js:58:1
@http://app.rawgraphs.io/js/controllers.js:255:7
$digest@http://app.rawgraphs.io/bower_components/angular/angular.min.js:145:373
$apply@http://app.rawgraphs.io/bower_components/angular/angular.min.js:148:339
e/q<@http://app.rawgraphs.io/bower_components/angular/angular.min.js:161:273
f@http://app.rawgraphs.io/bower_components/angular/angular.min.js:47:146
lg/k.defer/c<@http://app.rawgraphs.io/bower_components/angular/angular.min.js:50:68

Microsoft Edge 38.14393.1066.0 / Microsoft EdgeHTML 14.14393 :

TypeError: Unable to get property 'size' of undefined or null reference
at $scope.uploadFile (http://app.rawgraphs.io/js/controllers.js:58:7)
at Anonymous function (http://app.rawgraphs.io/js/controllers.js:255:7)
at m.prototype.$digest (http://app.rawgraphs.io/bower_components/angular/angular.min.js:145:373)
at m.prototype.$apply (http://app.rawgraphs.io/bower_components/angular/angular.min.js:148:339)
at Anonymous function (http://app.rawgraphs.io/bower_components/angular/angular.min.js:161:270)
at f (http://app.rawgraphs.io/bower_components/angular/angular.min.js:47:146)
at Anonymous function (http://app.rawgraphs.io/bower_components/angular/angular.min.js:50:68)

Google Chrome (Versione 58.0.3029.110 (64-bit):

TypeError: Cannot read property 'size' of null
    at m.$scope.uploadFile (controllers.js:58)
    at controllers.js:255
    at m.$digest (angular.js:17855)
    at m.$apply (angular.js:18125)
    at angular.js:19972
    at f (angular.js:6131)
    at angular.js:6411
Shoklan commented 7 years ago

It's getting this error on the size check: https://github.com/densitydesign/raw/blob/master/js/controllers.js#L58

This means something is happening between when angular is getting the file from the user and passing it to this function. I don't know anything about Angular so we're now out of the scope of what I can work on.

Shoklan commented 7 years ago

I just tried uploading a file to the live site and it works; going to load up a local server and see if the same file works there.

Shoklan commented 7 years ago

It works for this file now so maybe it's a file format thing? @BobHarper1 can you upload the file you were trying to test?

crime_homicide_subset.zip

BobHarper1 commented 7 years ago

Sorry for the lateness of my reply. Afraid that I'm still getting the same error with that datatset (but it works fine copy and paste).

Same message here Chrome Version 58.0.3029.110 (64-bit)

TypeError: Cannot read property 'size' of null                    (angular.js:14362)
    at m.$scope.uploadFile (controllers.js:58)
    at controllers.js:255
    at m.$digest (angular.js:17855)
    at m.$apply (angular.js:18125)
    at angular.js:19972
    at f (angular.js:6131)
    at angular.js:6411
Shoklan commented 7 years ago

@BobHarper1 are you trying a local server or are you using the actual website the designers have up right now?

comprateur commented 7 years ago

Hi same problem on app.rawgraphs.io csv, tsv doesn't work only excel

cheers

BobHarper1 commented 7 years ago

I think the problem lies with the file type validation.

When I attempt to upload .csv files, file.type as read from the console is type: "application/vnd.ms-excel", which is the standard MIME type for Excel files

Probably because I have excel configured as my default for opening csv files??? (like many others I presume)

There is also a problem for .json files which I attempt upload (file.type is simply "", so it also fails to parse).

I think the most simple fix to this that will be an improvement for the majority of users is to change the file load to search for .csv, .txt etc. in the file.name, as in the PR

namanjain1812 commented 6 years ago

@BobHarper1 please see if the changes i made are correct screen shot 2018-03-10 at 02 13 21

Igsu-Bravo commented 6 years ago

Similar problem in Firefox 62.0b7 where a .csv file won't be uploaded by any method (no drag nor manual upload).

Spaxe commented 4 years ago

This problem still persists today.

uf0 commented 3 years ago

no more an issue on v2