Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from file not working (Windows 10 Pro) #480

Closed
cyb3rko opened this issue Sep 4, 2021 · 9 comments
Closed

Import from file not working (Windows 10 Pro) #480

cyb3rko opened this issue Sep 4, 2021 · 9 comments
Labels
bug Something isn't working
Milestone

Comments

@cyb3rko
Copy link

cyb3rko commented Sep 4, 2021

Shlink web client version

  • Version: 3.2.0
  • How do you use shlink-web-client: app.shlink.io

Summary

If I try to import one / several servers from a file it gives the error:
"The servers could not be imported. Make sure the format is correct."

It's a file exported today so it's not outdated and formatted correctly.
On iMac importing from this file works.

Current behavior

Importing form file is not working on Windows 10.

Expected behavior

It should work :)

How to reproduce

Click "Add a server" on home page.
Click "Import from file".
Select the file on your pc.
The error occurs.

shlink-servers.csv

@cyb3rko cyb3rko added the bug Something isn't working label Sep 4, 2021
@acelaya
Copy link
Member

acelaya commented Sep 4, 2021

Can you share the file you are trying to upload? You can set fake URLs and API keys

@cyb3rko
Copy link
Author

cyb3rko commented Sep 4, 2021

Added it.

@acelaya
Copy link
Member

acelaya commented Sep 5, 2021

I have just imported your file as it is, using https://app.shlink.io, and it worked fine

I'll try to test from Windows, as I was on Linux.

Also, what browser are you using?

@acelaya
Copy link
Member

acelaya commented Sep 5, 2021

Yep, on windows, using either Google Chrome or Microsoft Edge, it throws the error.

I'll need to set-up a dev env in order to debug it, so it may take some time.

@cyb3rko
Copy link
Author

cyb3rko commented Sep 5, 2021

Okay, thanks for approving.
I tried Chrome and Edge on WIndows too, but did not try it out on Linux yet.
But if you already did, it should be fine.

@acelaya
Copy link
Member

acelaya commented Sep 5, 2021

I found the root cause.

The app is expecting provided file to have a type property with value text/csv, text/comma-separated-values or application/csv, but on Windows it resolves to an empty string on chromium-based browsers (with Firefox seems to work).

I guess I'll change the approach, and try to parse whatever file is provided, without checking the mime type, and then verify the result is a valid list of servers and no error is thrown in the process.

@cyb3rko
Copy link
Author

cyb3rko commented Sep 5, 2021

Perfect, thanks for investigating!

@acelaya acelaya added this to the 3.2.1 milestone Sep 12, 2021
@acelaya
Copy link
Member

acelaya commented Sep 12, 2021

I have just merged the fix for this. Will be part of v3.2.1

@acelaya acelaya closed this as completed Sep 12, 2021
@cyb3rko
Copy link
Author

cyb3rko commented Sep 12, 2021

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants