简体   繁体   English

asp.net上传控件在ipad中不起作用

[英]asp.net upload control is not working in ipad

The asp.net upload control is uploading the file for first time in Ipad but not after that and not even showing any error asp.net上传控件是第一次在Ipad中上传文件,但此后没有上传,甚至没有显示任何错误

The code is as below 代码如下

protected void UploadThisFile(FileUpload upload)
    {
        try
        {

            string folderpath = ConfigurationManager.AppSettings["BTCommDynamic"].ToString() + ConfigurationManager.AppSettings["Attachments"].ToString();
            Guid fileguid = Guid.NewGuid();
            string filename = fileguid + upload.FileName;
            if (upload.HasFile && dtFiles != null)
            {

                DataRow drFileRow = dtFiles.NewRow();
                drFileRow["FileName"] = upload.FileName;
                string theFileName = Path.Combine(Server.MapPath(folderpath), filename);
                string theFileName1 = Path.Combine(folderpath, filename);
                //string theFileName = folderpath;
                //to save the file in specified path
                upload.SaveAs(theFileName);
                drFileRow["FilePath"] = theFileName1;
                double Filesize = (upload.FileContent.Length);
                if (Filesize > 1024)
                {
                    drFileRow["FileSize"] = (upload.FileContent.Length / 1024).ToString() + " KB";
                }
                else
                {
                    drFileRow["FileSize"] = (upload.FileContent.Length).ToString() + " Bytes";
                }
                dtFiles.Rows.Add(drFileRow);
                gvAttachment.DataSource = dtFiles;
                gvAttachment.DataBind();
            }
        }
        catch (Exception ex)
        {
            string message = Utility.GetExceptionMessage(ex.GetType().ToString(), ex.Message);
            Display_Message(message);
        }

    }

Do you use firebug? 您使用萤火虫吗? There might be an error on a client side that prevents the work of your functionality. 客户端上可能存在错误,阻止了您的功能工作。 Do you have any logic on your client side? 您的客户端有逻辑吗? Some kinda jquery/ajax calls? 一些jquery / ajax调用?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM