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

IO Exception after changing storage for images #6602

Closed
exileDev opened this issue Feb 17, 2023 · 1 comment
Closed

IO Exception after changing storage for images #6602

exileDev opened this issue Feb 17, 2023 · 1 comment

Comments

@exileDev
Copy link
Contributor

nopCommerce version: develop

Steps to reproduce the problem:

I have Nopcommerce installed with pictures stored in database. After that I changed to file system and I got error when I first open any product. It looks like many processes try to create/update same file image.

System.IO.IOException: The process cannot access the file 'C:\Users\SSM\source\Workspaces\NopCommerce\nopCommerce461\src\Presentation\Nop.Web\wwwroot\images\0000036_0.jpeg' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.File.OpenHandle(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
   at System.IO.File.<WriteAllBytesAsync>g__Core|92_0(String path, Byte[] bytes, CancellationToken cancellationToken)
   at Nop.Core.Infrastructure.NopFileProvider.WriteAllBytesAsync(String filePath, Byte[] bytes) in C:\Users\SSM\source\Workspaces\NopCommerce\nopCommerce461\src\Libraries\Nop.Core\Infrastructure\NopFileProvider.cs:line 566
   at Nop.Services.Media.PictureService.SavePictureInFileAsync(Int32 pictureId, Byte[] pictureBinary, String mimeType) in C:\Users\SSM\source\Workspaces\NopCommerce\nopCommerce461\src\Libraries\Nop.Services\Media\PictureService.cs:line 108
...

Source: https://www.nopcommerce.com/en/boards/topic/96287/media-file-system

@exileDev
Copy link
Contributor Author

Closed #6602

mdy6 pushed a commit to rcsoffices/nopCommerce-origin that referenced this issue Jun 12, 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

1 participant