Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have some simple code that so far has worked on all mobile devices, as a PWA, except for the Note 10. The use snaps a pic with their mobile device that I load up to the server. It works on all devices except the Note 10. On that device, FileUpload1.HasFile is always false unless I browse to a gallery pic, not take a new photo with the camera.

//in the .aspx file
<asp:fileupload id="FileUpload1" runat="server" onclick="loadPicClick();" onchange="__doPostBack('', '');" accept=".jpg,.jpeg,">

//in the code behind
public partial class index : System.Web.UI.Page
{
static string unusedPic;

protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
// some initialization code
}


if (FileUpload1.HasFile)
{

string ulFile = DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString() + FileUpload1.FileName;
FileUpload1.SaveAs(Server.MapPath("~/Pics/" + ulFile));
// some more code not related
}

}

What I have tried:

I have tried adding Page.Form.Attributes.Add("enctype", "multipart/form-data");
to the page load.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900