Hi Chris,
in my case, I'm using web assembly and using the API found in your documentation for the files(image) upload. The uploads are working perfectly, I have an edit form to collect data of an idem and upload images.
I'm using dapper and I'm able to save the items data
[Required]
public int ItemIDNumber { get; set; }
[Required]
public string ItemName { get; set; }
[Required]
public string? ItemDescription { get; set; }
the item IDNumber is created automatically by sql
but I'm trying to find a way to save the image paths of the uploaded item to sqlserver database where each image associated with the item should have the itemIDNumber to its column
[Required]
public Guid ItemImageID { get; set; }
[Required]
public int ItemIDNumber { get; set; }
[Required]
public string ItemImageUrl { get; set; }
You can get the destination file path from the valuechange event. However, due to security concerns, the file path from the client machine is restricted.
Okay understood. But how can i save images to the server project directory without the API ?
i want to upload photos to a folder "Uploads" in the Server directory but before the upload, i want to be able to create guid for each file to rename the filename and save as the guid with its extension then get the new guid file name
You can refer to the below Syncfusion forum for more information about your requirement.
https://www.syncfusion.com/forums/157285/blazor-file-upload-not-working-webassembly?reply=NtVBkQ