Download problem on Blackberry and Android Browser RRS feed

  • Question

  • User-148820304 posted

    Hi All,

    I've trouble with my web apps, im using MVC3, here is my scratch code :

            public FileResult ViewPRAttachAjax(Int64 Id)
                //String StrCode = Request["q"].ToString();
                //Int64 Id = Int64.Parse(StrCode);    
                //nulis ke file
                RequsitionAttachmentRepository reqAttach = new RequsitionAttachmentRepository();
                RequsitionAttachmentViewModel att = reqAttach.GetAttachment(Id).SingleOrDefault();
                var physicalPath = Path.Combine(Server.MapPath("~/Content/Files/"), att.FileName);
                byte[] MyData = new byte[att.AttachReq.Length];
                using (FileStream fs = new FileStream(physicalPath, FileMode.Create, FileAccess.Write))
                    MyData = att.AttachReq;
                    fs.Write(MyData, 0, System.Convert.ToInt32(att.AttachReq.Length));
                return File(physicalPath, "application/octet-stream", att.FileName);

    The method works fine on IPhone (safari), Android (Opera and Dolphin) and Windows Mobile (IE)...

    However user encounter problem when accessing from Blackberry (default browser) and  Andoid (default browser). They always cannot download the file requested. Somehow it always failed, or download unsuccessfull.

    I've tried many ways, also i change the code

    return File(physicalPath, "application/octet-stream", att.FileName);


    return File(physicalPath, "application/pdf", att.FileName);
    return File(MyData, "application/octet-stream", att.FileName);
    return File(MyData, "application/pdf", att.FileName);

    Is there anybody has suggestion how can i solve my problem ??

    Wednesday, November 21, 2012 7:28 AM

All replies

  • User1943143334 posted


    Which BlackBerry OS are you using? Did you tried in BB OS 7?

    How about Android? Did you tried in Ice Cream Sanwich(4.0) OS?

    Moreover, FileDownload also depends on the network speed of the device and some devices doesn't support downloading large files!

    Hope it helps u...

    Wednesday, November 21, 2012 10:52 AM
  • User-148820304 posted

    Hi roopeshreddy,

    Various version of BB, I had tried with BB OS 5, 6, and 7. Also the android, using Gingerbread, Honeycomb, ICS, however it didnt works.

    for your information, i had tried with small file size.

    any suggestion?

    Wednesday, November 21, 2012 9:31 PM
  • User1943143334 posted


    Check this thread - http://stackoverflow.com/questions/5900604/downloading-files-in-an-android-3-0-browser-from-my-asp-net-site

    Moreover, instead of programatically pushing the file to the device, try providing a link to the file, like this -

    <a href="MySample.pdf">Download</a>

    Hope it helps u...

    Thursday, November 22, 2012 1:34 AM