File gets null after uploading image

Hi


I have a site in Blazor where I use RTE and I can paste images directly into the editor area (without using the toolbar image icon to insert images) and save them on my server.

when I paste image in RTE it will upload to my server and I am getting a null exception.




15 Replies 1 reply marked as answer

VJ Vinitha Jeyakumar Syncfusion Team June 21, 2023 12:17 PM UTC

Hi Adnan,

We have already included the fix for the reported issue "OnImageUploadSuccess event arguments passes null values for File in Rich Text Editor" with our patch release version 20.3.49. If you are using package version lower than this, please upgrade your package to the V20.3.49 or the latest to resolve the issue from your end.


Meanwhile we are facing an issue "Script error throws when pasting an image into the RichTextEditor" in the latest version and considered it as a bug from our end and the fix for the issue will be included with our upcoming patch release on 4th July 2023.

Now you can track the status of the reported issue through the feedback below,

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Regards,
Vinitha




AK Adnan Khan replied to Vinitha Jeyakumar June 21, 2023 01:50 PM UTC

Hi Vinitha JeyaKumar,
I am using  V20.4.49 and still, I have to get the error.
when I paste the image in the RTE after saving image in the DB ImageUploadSuccess event fired and File is null in the ImageSuccessEventArgs.




IS Indrajith Srinivasan Syncfusion Team June 22, 2023 09:20 AM UTC

Hi Adnan,


We are able to reproduce the reported issue in the V20.4.49. In order to resolve the reported issue, we suggest you to upgrade the Version to the version 21.1.41. We have also prepared a sample, and attached with this response in which the File is returned properly.


Please let us know if you face any difficulties,


Regards,

Indrajith


Attachment: SfRichTextEditor_image_rename_19ef0532.zip


AK Adnan Khan June 22, 2023 12:06 PM UTC

Hi Indrajith Srinivasan,

thanks for your response I checked your sample project it works fine with the Path URL. When we remove the path it will show an image crack icon with the name. I used to upload images on blob I don't want to use path.




IS Indrajith Srinivasan Syncfusion Team June 23, 2023 09:47 AM UTC

Adnan,


The Path property is mandatory for the Image’s being uploaded in the server when the SaveUrl is being configured. If you want to save the image as Blob, you can use the SaveFormat type as SaveFormat.Blob. Check the below shared documentation for reference.


Documentation: https://blazor.syncfusion.com/documentation/rich-text-editor/tools/insert-image#image-save-format


If the above suggestion doesn’t help your needs, you can also try the below way of setting the Path property as empty string and load the image path in the OnImageUploadSuccess event to load the image from a local resource. Check the below shared code blocks and screeshot for reference.



 

public void ImageUploadSucess(ImageSuccessEventArgs args)

    {

        var headers = args.Response.Headers.ToString();

        header = headers.Split("name: ");

        header = header[1].Split("\r");

 

        // Update the modified image name to display a image in the editor.

        args.File.Name = "./Images/DocTemplate/dropArea/" + header[0];

       

    }


Regards,

Indrajith



AK Adnan Khan June 26, 2023 01:25 PM UTC

Hi Indrajith Srinivasan,
I updated Syncfusion version: 21.1.41 ​and still, I am getting file null.


Marked as answer

VY Vinothkumar Yuvaraj Syncfusion Team June 26, 2023 04:29 PM UTC

Hi Adnan,


We have checked your issue in the 21.1.41 Package version, but we were not able to replicate your problem. Please see the attached video and sample for your reference.


We suggest clearing the cache and then running the application. You can follow the documentation provided at the following link to remove the cache:

https://support.syncfusion.com/kb/article/6265/how-to-clear-nuget-cache


If you are still encountering an error, could you please share the following information with us to replicate the problem on our end?

  • If possible, please modify the shared sample with the issue replicating code.
  • If possible, could you please share with us a sample that reproduces the issue?
  • Could you please share your availability to schedule a web meeting to check and discuss the reported issue on your machine?

Attachment: Sample_d02cbd9d.zip


AK Adnan Khan June 27, 2023 01:29 PM UTC

Hi Vinothkumar Yuvaraj,
I am available until IST 12:00 Am.



VY Vinothkumar Yuvaraj Syncfusion Team June 28, 2023 03:53 PM UTC

Hi Adnan,


Can you share the below details, as requested in the last update, to check further at our end?


Please modify the shared sample with the issue replicating code.


Share a sample that reproduces the issue.



AK Adnan Khan July 6, 2023 07:42 AM UTC

Hi  Vinothkumar Yuvaraj,
now this working fine 
thank you for your help :)




AK Adnan Khan July 6, 2023 02:28 PM UTC

Hi VinothKumar Yuvraj,
I am using the latest version of syncfusion and now I am not able to use large screenshot pictures.

Can you please help 

Please check attached.



Attachment: largeimageissue_cd10a9bf.zip


VY Vinothkumar Yuvaraj Syncfusion Team July 7, 2023 01:10 PM UTC

Hi Adnan,


We suspect that the issue occurred due to a buffer limitation in Blazor. Therefore, to upload large files in the Rich Text Editor, you need to increase the buffer size. You can adjust the buffer size manually in the startup.cs file of your project to resolve the issue. Please refer to the following code snippet:


startup.cs

services.AddSignalR(e => { e.MaximumReceiveMessageSize = 102400000; }); 


For more information on Blazor buffer limitations, please see :  https://docs.microsoft.com/en-us/aspnet/core/signalr/security?view=aspnetcore-2.1#buffer-management


Attachment: SfRichTextEditor_image_f6176c11_a2863d0.zip


AK Adnan Khan replied to Vinothkumar Yuvaraj July 7, 2023 01:13 PM UTC

Hi Vinothkumar,
thanks it works.

I want to upload a file in SfUploader and get stream null.
did you know why ?



VJ Vinitha Jeyakumar Syncfusion Team July 10, 2023 07:12 AM UTC

Hi Adnan Khan,


Query "I want to upload a file in SfUploader and get stream null.
did you know why ?"

We have created a separate forum for your query related to Uploader control, Please follow up on the below link for further information


Regards,
Vinitha


VY Vinothkumar Yuvaraj Syncfusion Team August 7, 2023 06:26 AM UTC

Hi Adnan,


We have included the fix for the issue "Script error throws when pasting an image into the RichTextEditor" with our package version 22.1.37. So, can you please upgrade your package to the latest version to resolve the issue on your end.


Release notes: https://blazor.syncfusion.com/documentation/release-notes/22.1.37?type=all#rich-text-editor


Regards,

Vinothkumar


Loader.
Up arrow icon