gdcc / dvwebloader

A web tool for uploading folders of files to a Dataverse dataset
Apache License 2.0
1 stars 8 forks source link

directory upload not working #10

Closed Louis-wr closed 1 year ago

Louis-wr commented 1 year ago

Current behavior:

Directory upload is apparently currently not working, when uploading a directory we get the flowing console out and nothing gets uploaded :

before folder/Screenshot_2022-04-08_10-35-37.png fileupload2.js:61:21
Screenshot_2022-04-08_10-35-37.png  fileupload2.js:558:13

Uncaught TypeError: right-hand side of 'in' should be an object, got undefined
    queueFileForDirectUpload https://gdcc.github.io/dvwebloader/src/js/fileupload2.js:559
    onchange https://gdcc.github.io/dvwebloader/src/js/fileupload2.js:62

Expected behavior :

No error/files uploaded

Reproducing steps :

Use Dvwebloader to upload a directory

qqmyers commented 1 year ago

With a quick look at the code, I think this can happen if you click select directory before the call to check the dataset for existing files completes. I'll fix that but a workaround is probably just to delay clicking select folder - either for a few seconds or watching in the console for the call to Dataverse to complete.

qqmyers commented 1 year ago

This should be fixed. The Select a Directory button is disabled until the query to get Dataset info is complete, and it is removed once you've chosen the directory.

Louis-wr commented 1 year ago

Thank you, I indeed fixed it, however it turns out the underlying issue was a missing api token. Now thanks to your fix the error is clearly pointing to that.