Foxtable(狐表)用户栏目专家坐堂 → 移动开发 照片上传咨询


  共有2772人关注过本帖树形打印复制链接

主题:移动开发 照片上传咨询

帅哥哟,离线,有人找我吗?
浙江仔
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1326 积分:9603 威望:0 精华:1 注册:2010/7/21 14:20:00
  发帖心情 Post By:2017/9/20 9:29:00 [显示全部帖子]

  我把每个照片的路径作为一条记录,放在C_SI_Estimate_DTL_FILES表中

显示如下: 

        Dim sdr As  DataRow = DataTables("C_SI_Estimate_DTL_FILES").SQLFind("DTL_id = '" & xdr("DTL_id")  & "' and IS_ACTIVE ='1' ")

            With .AddUploader("up1","照片",True) 'True表示允许上传多个文件

                .ScaleWidth= 800

                If sdr IsNot Nothing Then

                    For Each dr As DataRow In DataTables("C_SI_Estimate_DTL_FILES").SQLSelect("DTL_id = '" & xdr("DTL_id")  & "' and is_active='1' ")

                        .AddImage( "./upload/" & dr("FILES_SAVENAME") )

                    Next

                End If

               

            End With

 

 

保存附件如下:

 

 

    '保存附件

    For Each key As String In e.Files.Keys

        If key = "up1" Then

            For Each fln As String In e.Files(key)

                Dim s As String=fln

                s=s.substring(s.LastIndexOf("."))

                Dim s2 As String =Guid.NewGuid().ToString().replace("-","")

                s= s2  & s

                e.SaveFile(key, fln, ProjectPath & "web\upload\" & s)

                Dim dr2 As DataRow = DataTables("C_SI_Estimate_DTL_FILES").SQLAddNew()

                dr2("FILES_SAVENAME") = s

                dr2("FILES_NAME") = fln

                dr2("DTL_id")=Dtlid

                dr2("CREATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

                dr2("UPDATE_TIME")=now.Tostring.replace("-","").replace(" ","").replace(":","")

                dr2("IS_ACTIVE")="1"

                If openid>"" Then

                    dr2("creator")=fdp("person_id")

                   

                Else

                    dr2("creator")="test"

                End If

                dr2.save()

            Next

        End If

    Next


 回到顶部