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

时间:2013-09-25 10:44:34

标签: asp.net ipad file-upload

asp.net上传控件是首次在Ipad上传文件,但之后没有,甚至没有显示任何错误

代码如下

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);
        }

    }

1 个答案:

答案 0 :(得分:0)

你使用萤火虫吗?客户端可能存在错误,导致功能无法正常工作。 你的客户端有任何逻辑吗?有些jquery / ajax调用?