Issue in open save on HTTPS

Recently we at NCQA bought Aspose.Words 9.7; everything worked fine as long as we use http:; Once I moved my pages to https:, the Open and Save command resulted in errors “internet Explorer can not download .aspx page…”; I saw a few people has reported this issue but I could not locate a perfect solution for this. Any help is apprecieated

This message was posted using Email2Forum by alexey.noskov.

Hello,
Thank you for your inquiry.
Could you describe how you call the procedure. Could you create a simple application that would help us reproduce the problem.
Just to open the document from the url you must first download the document and write it into the stream. Like this:

///

/// Opens document from web.
///
private Document OpenDocumentFromUrl(string url)
{
    // Prepare the web page we will be asking for
    HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
    request.Method = "GET";
    request.ContentType = "application/msword";
    request.UserAgent = "Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0";
    // Execute the request
    HttpWebResponse response = (HttpWebResponse) request.GetResponse();
    // We will read data via the response stream
    Stream resStream = response.GetResponseStream();
    // Write content into the MemoryStream BinaryReader resReader = new BinaryReader(resStream);
    MemoryStream docStream = new MemoryStream(resReader.ReadBytes((int) response.ContentLength));
    // Open document from stream.
    Document doc = new Document(docStream);
    return doc;
}

If an error occurs when sending a document to the client browser, try using this code for testing. This code simulates our method of Saving. If it will raise the same error, then the problem is most likely on your server or IIS configuration:

Response.Clear();
// Specify the document type.
Response.ContentType = "application/word";
// Other options:
// Response.ContentType = "text/plain"
// Response.ContentType = "text/html"
// Specify how the document is sent to the browser.
// Response.AddHeader("content-disposition","attachment; filename=MyDocument.doc");
// Another option could be:
Response.AddHeader("content-disposition", "inline; filename=out.doc");
// Get data bytes from the stream and send it to the response.
byte[] bytes = stream.GetBuffer();
Response.BinaryWrite(bytes);
Response.End();

Hope it helps.

Viktor,
First of all thanks for a quick response. I am attaching a document that has the code and explains the error as well; hope it will help you to resolve the issue I have. This is how I call the save method

doc.Save(Response, filename, ContentDisposition.Inline, null);

This works fine when the code executes on http:// and fails on https:// Based on one of Aspose threads, I added the following code before doc.save which does not seem to help.
Response.Cache.SetCacheability(HttpCacheability.NoCache); //Added 03/30/2011 https://forum.aspose.com/t/124928
Thanks
-Raghav

Hello
Thank you for additional information. I think this problem is not related to Aspose.Words. Please see the following links for more information:
https://social.msdn.microsoft.com/Forums/en-US/0fe3da61-bff6-41c0-8f7e-d54a8d8be0dd/getting-error-message-quotinternet-explorer-cannot-download-aspxquot-in-the-https
Hope this helps.
Best regards,