Issue
Ive to upload image along with the item and save this images in the local folder and the server image repository and the image url should be passed to db. (Have to combine the filepath and the physicalpath ) The code below is not working.
@code{
.
.
.
.
foreach (var file in args.Files)
{
var size = file.FileInfo.Size;
path = "wwwroot\images\" + file.FileInfo.Name;
FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write);
file.Stream.WriteTo(filestream);
filestream.Close();
file.Stream.Close();
var pathUrl = path;
}.
.
.
.
arg.Data.ItemImage = path;
}
Solution
Hy, I used this dev express control for achieving this :
https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxUpload
It needs some tuning butt in case you follow the examples it works great. Also make sure you have write premission in the folder your willing to save the files.
Give it a try, and let me know in case you got stuck.
Best regards,
Mathias
Answered By - Mathias Z Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.