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

Possible error downloading files when importing products #5299

Open
RomanovM opened this issue Jan 25, 2021 · 2 comments
Open

Possible error downloading files when importing products #5299

RomanovM opened this issue Jan 25, 2021 · 2 comments
Assignees

Comments

@RomanovM
Copy link
Contributor

nopCommerce version: 4.30

The Uri.IsWellFormedUriString function sometimes returns a false negative depending on the characters in the URI (see dotnet/runtime#21626). In my case some image file names had the ^ character in it.
The workaround I am using is to url encode the image string before checking if it is a valid uri. I also had to change uri kind from Absolute to RelativeOrAbsolute for it to work.

In the Nop.Services/ExportImport/ImportManager.cs file I changed the function DownloadFile as follows:

Before:

if (!Uri.IsWellFormedUriString(urlString, UriKind.Absolute))
  return urlString;

After:

var encodedUrl = System.Web.HttpUtility.UrlEncode(urlString);
if (!Uri.IsWellFormedUriString(encodedUrl, UriKind.RelativeOrAbsolute))
  return urlString;

Source: https://www.nopcommerce.com/boards/topic/79591/product_picture_mapping-issue#280288

@RomanovM
Copy link
Contributor Author

Decided not to come up with workarounds and wait for dotnet team to fix this bug.

@AndreiMaz AndreiMaz assigned holydk and unassigned skoshelev Apr 18, 2021
@RomanovM RomanovM assigned skoshelev and unassigned holydk Sep 29, 2021
@RomanovM RomanovM modified the milestones: Version 4.50, Version 4.60 Oct 1, 2021
@AndreiMaz AndreiMaz modified the milestones: Version 4.60, Version 4.70 Nov 12, 2021
@AndreiMaz AndreiMaz removed this from the Version 4.70 milestone Nov 16, 2022
@RomanovM RomanovM added this to the Version 4.70 milestone Jan 23, 2023
@skoshelev skoshelev self-assigned this Jan 24, 2023
@skoshelev
Copy link
Contributor

We are waiting for a solution to the #72632 ticket from the dotnet team

@skoshelev skoshelev removed this from the Version 4.70 milestone Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants