手动上传文件到数据表

    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");
        }
    }
posted @ 2012-08-02 11:51  perock  阅读(392)  评论(0编辑  收藏  举报