none
PushStreamContent - Download file RRS feed

  • Question

  • Hi,

    I have below code to download a file.

            Download document method 

                    response.Content = new PushStreamContent((stream, content, ctx) => this.WriteToStream(stream, content, ctx, documentMetadata, 1),
                        new MediaTypeHeaderValue(MimeMapping.GetMimeMapping(documentMetadata.Name)));
                    response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
                    response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")


    So, I am facing issue, depending of file size it is taking more time to throw save / open browser pop up.

    Any help in term of getting early pop up for Save / Open would appreciated.

    • Moved by CoolDadTx Thursday, May 9, 2019 2:00 PM ASP.NET related
    Thursday, May 9, 2019 2:54 AM

All replies

  • Hi Rahul,

    Thank you for posting here.

    For you question, could you provide a complete code with me?

    Also,Please edit your post and place well formatted code into code blocks.

    We are waiting for your update.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, May 9, 2019 5:02 AM
  • This question is related to MVC. Please post questions related to MVC in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, May 9, 2019 2:00 PM