NOt Prompted to save when saving using output.streams

Last post 01-05-2010, 2:53 AM by msabir. 3 replies.
Sort Posts: Previous Next
  •  01-04-2010, 8:17 PM 215532

    NOt Prompted to save when saving using output.streams .NET

    I applied the snippet of sample code provided in the documentation for saving presentations to create a blank slide and save it. However I am not prompted when I step through and run the code. The code is below.  I've commented out hte response.end statement since it was generating  a "thread aborted error".  Note: the form that this code is in is being called via AJAX.

    Ajax code:

    function getPrintableHTML()

    {

    var printHTML

    //alert(parent.frames[1].document.documentElement.innerHTML);

    printHTML=encodeURIComponent("<HTML>" + parent.frames[1].document.documentElement.innerHTML + "</HTML>");

    var params = "&printHTML=" + encodeURIComponent(printHTML);

    //var params = "&printHTML=1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";

    // Make the Ajax call and pass in the parameters.

    ajaxCall = makeSyncAjaxTextRequest("PowerpointConverter.aspx", params);

    }

     

     

     

    function makeSyncAjaxTextRequest(url, params)

    {

    getHTTPRequestObject();

    XMLHttp.open("POST", url, false);

    //XMLHttp.setRequestHeader("Content-Type", "text/html");

    XMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

    XMLHttp.setRequestHeader("Content-length", params.length);

    XMLHttp.send(params);

    return XMLHttp.responseText;

    }

    Thanks

    Dim pres As Presentation = New Presentation()

    '....do some work here.....

    Try

    'Setting the content type of the Http Response

    Me.Response.ContentType = "application/vnd.ms-powerpoint"

    'Appending the header of the Http Response to contain the presentation file name

    Me.Response.AppendHeader("Content-Disposition", "attachment; filename=demo.ppt")

    'Flushing the buffers of Http Response

    Me.Response.Flush()

    'Accessing the output stream of Http Response

    Dim st As System.IO.Stream = Me.Response.OutputStream

    'Saving the presentation to the output stream of Http Response

    pres.Write(st)

    'Closing the Http Response

    'Me.Response.End()

    Catch Err As Exception

    Throw Err

    End Try

    Filed under: Ajax;asp.NET;powerpoint
     
  •  01-05-2010, 12:37 AM 215544 in reply to 215532

    Re: NOt Prompted to save when saving using output.streams

    Hi,

    I have just cheched the code provided by you in a simple ASP.NET web site and it is working fine. First you should test it without Ajax and later on with AJAX.


    Muhammad Sabir
    Support Assistant Manager
    Aspose Sialkot Team
    http://www.aspose.com
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
  •  01-05-2010, 1:28 AM 215560 in reply to 215544

    Re: NOt Prompted to save when saving using output.streams

    Indeed when called without AJAX it works fine.  Trying determine what is is with calling the page containing the code that causes the failure.
     
  •  01-05-2010, 2:53 AM 215577 in reply to 215560

    Re: NOt Prompted to save when saving using output.streams

    Hi,

    It means this issue is more related with AJAX capability / architecture and the AJAX code written by you, otherwise there is no such limitation as far as "Aspose.Slides for .NET" capability is concerned.


    Muhammad Sabir
    Support Assistant Manager
    Aspose Sialkot Team
    http://www.aspose.com
    Aspose - Your File Format Experts

    Keep in touch! We're on Twitter and Facebook
     
View as RSS news feed in XML