Click here to Skip to main content
14,580,625 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100