Esempio n. 1
0
        private async Task SubmitProfileImageForm(IBrowserFile file)
        {
            videoSaved = false;

            fileName = file.Name;
            stream   = file.OpenReadStream();

            imageSource = Base64ImageEncoder.EncodeImage(stream, file.ContentType);

            if (!string.IsNullOrEmpty(Id))
            {
                try
                {
                    var imageUrl = await ConsultantProfilesClient.UploadProfileImageAsync(Guid.Parse(Id), new FileParameter(stream, fileName));

                    consultant.ProfileImage = imageUrl;

                    videoSaved = true;

                    await imageUploadModal.Close();
                }

                /* catch (ApiException exc)
                 * {
                 * }
                 * catch (HttpRequestException exc)
                 * {
                 * } */
                catch (Exception exc)
                {
                    await JSHelpers.Alert(exc.Message);
                }
            }
        }
Esempio n. 2
0
 public void Setup()
 {
     _base64Converter = new Base64ImageEncoder();
 }