Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

An Error Occurred during Submit Process. Cannot Process content of type text/html

Avatar

Level 2

Hello All,

I am submitting the form data to server using HTTP submit button. I am stuck in a weird situtation:

When I fill the form and click submit and my Firefox is open than I get this error "An Error Occurred during Submit Process. Cannot Process content of type text/html". However the data get submit to server and stores into the DB

If Firefox is closed then I get Confirmation (echo) via IE.

I tried everything but some how I am not able to figure out this problem.

Can any one please guide me or tell where I am going wrong?

Thanks

Viral

1 Reply

Avatar

Former Community Member

It is expecting PDF contents in return from server. Even if your return type is empty.

You can put a pdf file on server and simply use Page.Response.Redirect("success.pdf");
If you are using C# then following MemoryStream can be return

  private MemoryStream CreatePDFStream(string text)

        {

            var pdfMemoryStream = new MemoryStream();

            try

            {

               //Create new PDF runtime OR read a saved PDF from server.

                Document document = new Document();

                PdfWriter.GetInstance(document, pdfMemoryStream)

                        .CloseStream = false;

                document.Open();

                document.Add(new Paragraph(text));

                document.Close();

                byte[] byteInfo = pdfMemoryStream.ToArray();

                pdfMemoryStream.Write(byteInfo, 0, byteInfo.Length);

                pdfMemoryStream.Position = 0;

               

                if (WebOperationContext.Current != null)

                {

                    WebOperationContext.Current.OutgoingResponse.ContentType = "application/pdf";

                }

                return pdfMemoryStream;

            }

            catch (Exception ex)

            {    

                return pdfMemoryStream;       

            }

        }