You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i upload image on blazor using MinioService, i got this error. Can anyone solve this problem, So i want insert image to database, didnt work, because i got this error, at var dataStreams
public async Task InsertNewHospital(HospitalFormModel hospitalForm)
{
var result = JsonConvert.DeserializeObject<PositionInfo>(hospitalForm.PositionInfo);
decimal lat = result.Lat;
decimal lng = result.Lng;
var imageBlobId = Guid.NewGuid();
var HospitalId = Guid.NewGuid();
var data = hospitalForm.ImageRumahSakit;
var dataStreams = data.Data;
var dataType = data.Type;
var dataName = data.Name;
//To Do buat cek validasi image
if( imageBlobId != null)
{
var imageBlob = new Blobs
{
BlobId = imageBlobId,
BlobName = dataName,
BlobMime = dataType
};
await this.MinioService.UploadFile(imageBlobId, dataType, dataStreams);
DB.Blobs.Add(imageBlob);
}
//Add To Database hospital
var hospital = new Hospitals
{
Address = hospitalForm.HospitalAddress,
HospitalName = hospitalForm.HospitalName,
Description = hospitalForm.HospitalAddress,
HospitalId = HospitalId,
Longitude = lng,
Latitude = lat,
PhoneNumber1 = hospitalForm.PhoneNumber,
PhoneNumber2 = hospitalForm.PhoneNumber2,
Branch = hospitalForm.Branch,
StartOprTime = hospitalForm.StartOp,
EndOprTime = hospitalForm.EndOp,
BankAccountNo = hospitalForm.BankAccount,
BankCode = hospitalForm.BankCode,
};
DB.Hospitals.Add(hospital);
await DB.SaveChangesAsync();
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When i upload image on blazor using MinioService, i got this error. Can anyone solve this problem, So i want insert image to database, didnt work, because i got this error, at var dataStreams
(url)
Beta Was this translation helpful? Give feedback.
All reactions