locked
PDF via Response.redirect or direct send does not work RRS feed

  • Question

  • We have a web site which has a mobile section. We store some PDF's in a Database, retrieve them as needed and send the file to the client.

    IT works fine on a desktop/notebook, iPhone. but on Windows Phone it just opens the reader, "downloads the file and says "Tap to open", but won't. Saving the file and doing a Response.Redirect doesn't work either.Only saving the file and setting up a JavaScript href to do a location =

    Will this be fixed, or do I need the workaround.


    - Bill Surface Pro 128gb, Win 8 Pro 64 bit, MS Expression 4, Office 365 Home Premium, Visual Studio Professional 2013, SQL Server 2012 Express

    Monday, November 11, 2013 4:27 PM

Answers

All replies

  • Nobody home?

    - Bill Surface Pro 128gb, Win 8 Pro 64 bit, MS Expression 4, Office 365 Home Premium, Visual Studio Professional 2013, SQL Server 2012 Express

    Wednesday, December 18, 2013 3:05 AM
  • I apologize Bill, we missed your original post. Could you provide me some steps so I can attempt to reproduce the issue?

    David

    Wednesday, December 18, 2013 3:11 PM
    Moderator
  • I would be happy to, but not sure how to do that as site is a secure one.

    The site is nausetnewcomers.org.

    Must be done on a Windows Phone

    go to /AboutUs/Leadership/Minutes/Minutes.aspx

    OR Use the menu.

    Sign In and try and download any of the minutes there.

    The file will download and the reader (Microsoft or Adobe) will say tap to open and nothing happens.

    You will need credentials. Provide a way to send them securely, please


    - Bill Surface Pro 128gb, Win 8 Pro 64 bit, MS Expression 4, Office 365 Home Premium, Visual Studio Professional 2013, SQL Server 2012 Express

    Wednesday, December 18, 2013 3:50 PM
  • I suppose the easiest way would be to email me directly at David.Alessi@Microsoft.com
    Wednesday, December 18, 2013 6:45 PM
    Moderator
  • I can reproduce this easily.  Hitting retry seems to resolve over multiple attempts (3-5) and eventual lets me download the PDF.  I will be looking into this deeper over the next few days to provide further insight into what we are seeing here.

    Thanks and have a great day!

    -MikeDano

    Wednesday, December 18, 2013 10:30 PM
    Moderator
  • Thanks,

    Never a problem in when NOT using phone. Always a problem when using phone (PDF Reader or Adobe Reader. The code that send it look like this:

    Dim PDFContent() As Byte = objCmd.ExecuteScalar
            objCmd.Dispose()
            objConn.Dispose()
            Response.Clear()
            Response.ClearContent()
            Response.ClearHeaders()
            Response.ContentType = "application/pdf"
            Response.Charset = String.Empty
            Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache)
            Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName)
            Response.OutputStream.Write(PDFContent, 0, PDFContent.Length)
            Response.OutputStream.Flush()
            Response.OutputStream.Close()
            Response.End()


    - Bill using: Surface Pro 128gb, Win 8.1 Pro 64 bit, Office 365 Home Premium, Visual Studio Web Developer 2013, MS Expression 4, SQL Server 2012 Express

    Wednesday, December 18, 2013 10:42 PM
  • Not having heard back, security change let me know if you need any assistance

    - Bill using: Surface Pro 128gb, Win 8.1 Pro 64 bit, Office 365 Home Premium, Visual Studio Web Developer 2013, MS Expression 4, SQL Server 2012 Express

    Tuesday, January 14, 2014 2:43 PM
  • Sorry for the delay Bill,

    Still looking into this.  Does this work if you point IE directly to the PDF location?

    Tuesday, January 14, 2014 11:48 PM
    Moderator
  • When there is a direct link to an actual PDF it works using the link, but when is links to a DB stored PDF, when the data is sent to the phone, it is clear that the data is there, but is stops at the tap to open and nothing happens. (e.g. the minutes)

    - Bill using: Surface Pro 128gb, Win 8.1 Pro 64 bit, Office 365 Home Premium, Visual Studio Web Developer 2013, MS Expression 4, SQL Server 2012 Express

    Wednesday, January 15, 2014 1:41 AM
  • Bill confirmed that this is fixed in the 8.1 preview.

    David

    Thursday, April 17, 2014 5:58 PM
    Moderator