Getting Identity of uploaded image

Results 1 to 2 of 2

Thread: Getting Identity of uploaded image

  1. #1
    Join Date
    Dec 1969

    Default Getting Identity of uploaded image

    Hi<BR><BR>I am trying to get the identity of an image uploaded to sql. The script workks fine for a normal table but not for images!<BR><BR>Code:<BR><BR> Dim Uploader, File<BR> Set Uploader = New FileUploader<BR> Uploader.Upload()<BR><BR> If Uploader.Files.Count = 0 Then<BR> Response.Write "File(s) not uploaded."<BR> Else<BR> For Each File In Uploader.Files.Items<BR> Set Conn = Server.CreateObject("ADODB.Connection")<BR> Set RS = Server.CreateObject("ADODB.Recordset")<BR> strconnect <BR> RS.Open "Images", Conn, 2, 2<BR> <BR> RS.AddNew<BR> RS("imagepath") = File.FileName<BR> RS("imagesize") = File.FileSize<BR> RS("contenttype") = File.ContentType<BR> File.SaveToDatabase RS("imageblob")<BR> RS.Update<BR> <BR> <BR> Set RS = Conn.Execute( "SELECT @@IDENTITY" )<BR> theimageid = RS(0)<BR> <BR> response.write "imageid=" & theimageid<BR> <BR> RS.Close <BR> Next<BR><BR>Any Ideas<BR><BR>Thanks<BR><BR>Gary

  2. #2
    Join Date
    Dec 1969

    Default See

    .. .in the Databases, General category.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts