locked
Webview mail attachment Download in Windows 8.1 RRS feed

  • Question

  • I am trying to download attachment of my web email by opening it in webview of windwos8.1. But whenever I click on download it, I am directed to IE asking to login and after that download happens. And also download link doesn't end with ".zip",".pdf" for example but is

    https:/abcd.myCompany.com/xyz/attachment.ashx?`attach=1&id=RgAAAABad%2bfJqXwSQa2v%2b1otLJGzBwByBRTOAw%2fVTovnczC49w01AAAADlTIAAB11uY6DrbwRaG30brbaRZqAAAZC7D3AAAJ&attid0=BAAAAAAA&attcnt=1*`

    Can anyone tell me how to do it in webview single Window application, so that it is not directed to IE when download attachment is clicked?


    Wednesday, September 11, 2013 8:07 AM

Answers

  • Hi

    I've taken a look at this using the XAML WebView C# sample here:

    http://code.msdn.microsoft.com/windowsapps/XAML-WebView-control-sample-58ad63f7

    Using the URL Navigation scenario in that I browsed to my Hotmail inbox and clicked to download an email attachment and it launched IE as you say.

    I could also see the webView1_UnviewableContentIdentified firing. The sample has code that launches the URL in the browser. In that event in the sample if you comment out the line that calls LaunchUriAsync and set pageIsLoading to true the browser is no longer launched.

    Regards

    Doug

    Thursday, September 19, 2013 3:49 PM
    Moderator

All replies

  • Hello

    Did your solution previously work in Windows 8?

    Which web mail service do you use?

    Can you confirm if the following is a correct paraphrase of your scenario please?

    "You have a Windows Store app that uses a WebView control. Within that WebView you browse to your web based mail service. You then interact with that web based mail service, open an email (all rendered within the WebView) and then on clicking on an attachment, IE is launched and after logging in again to the web mail service within IE the attachment is downloaded by IE"

    Thanks

    Doug

    Wednesday, September 11, 2013 9:51 AM
    Moderator
  • yes i Confirm scenario 

    I did not try it in Windows8 as it was not possible to download anything there

    But in Winodws8.1 i can use "Unviewable Content Identified " event  to download, but it is possible only when with it is direct url to pdf like "www.fdfd.com/sdsd/sds/abc.pdf  for example.

    At least there should be some way not to launch "IE" application and take away user attention from my app. but rather bring app to Unviewable Content Identified " event


    Wednesday, September 11, 2013 10:19 AM
  • Ok.   The WebView has determined the content to be unviewable and you can use the new event to be notified of that, as you say.  From there you will have to make a decision about what to do with it. Since the mail provider is not giving you a URL from which you can guess what it is (and even if it did offer you, say, something with a PDF extension you would not actually know that it IS a PDF) you will have to implement something that processes that URL (for example by doing a background transfer on the assumption it is a file). There is a sample on background transfer here:

    http://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61

    Regards

    Doug

    Wednesday, September 11, 2013 11:13 AM
    Moderator
  • Problem is that IE is launched when i click on download button in webview 

    that should not happen 

    how do i stop that and direct  it to  Unviewable Content Identified

    I am already using BackgroundTransfer

    Problem lies when IE is getting launched i dont know why ?

    Wednesday, September 11, 2013 11:24 AM
  • Hi

    I've taken a look at this using the XAML WebView C# sample here:

    http://code.msdn.microsoft.com/windowsapps/XAML-WebView-control-sample-58ad63f7

    Using the URL Navigation scenario in that I browsed to my Hotmail inbox and clicked to download an email attachment and it launched IE as you say.

    I could also see the webView1_UnviewableContentIdentified firing. The sample has code that launches the URL in the browser. In that event in the sample if you comment out the line that calls LaunchUriAsync and set pageIsLoading to true the browser is no longer launched.

    Regards

    Doug

    Thursday, September 19, 2013 3:49 PM
    Moderator