现在的位置: 首页 > 综合 > 正文

手动上传文件到数据表

2013年01月29日 ⁄ 综合 ⁄ 共 1093字 ⁄ 字号 评论关闭
    FilenameFilter filter = ['Image Files', '*.bmp;*.jpg;*.gif;*.jpeg'];
    BinData binData = new BinData();
    str extest, filepath, nameofFile;
    ;
    super();
    imageFilePathName = WinAPI::getOpenFileName(element.hWnd(),filter,'',"abc");
    if(imageFilePathName && WinAPI::fileExists(imageFilePathName))
    {
        [filepath, nameOfFile,extest] = fileNameSplit(imageFilePathName);
        if(extest== '.bmp' || extest== '.jpg' || extest== '.gif' || extest== '.jpeg')
        {
            bindata.loadFile(imageFilePathName);
            imageContainer = bindata.getData();
           TestTable.Image =imageContainer;
           TestTable.write();
        }
        else
        {
            throw error("Error in uploading");
        }
    }

抱歉!评论已关闭.