Using ASPUpload 3.0 sending image and info to Spro

Results 1 to 2 of 2

Thread: Using ASPUpload 3.0 sending image and info to Spro

  1. #1
    Join Date
    Dec 1969

    Default Using ASPUpload 3.0 sending image and info to Spro

    Hey I wanna have an image that sends all the information of the image and the image to a stored procedure where there I can do some data verification to make sure the user hasnt exceeded the size total. But basically I just want to be able to send the data from Persists ASPUpload 3.0 to a Stored Procedure. I have tried several ways and have tried searching the web on how to do this. My only hope is this:<BR><BR>"&#060;% <BR>Set Upload = Server.CreateObject("Persits.Upload.1") <BR>Count = Upload.Save("c:upload") <BR>ConnectStr = "Driver={SQL Server};Server=MYSERVER;Database=Pubs;UID=sa;PWD=" <BR>Set rs = Server.CreateObject("adodb.recordset") <BR>rs.Open "MYIMAGES", ConnectStr, 2, 3 <BR>rs.AddNew <BR><BR>Set File = Upload.Files("FILE1") <BR>If Not File Is Nothing Then rs("Image1").Value = File.Binary <BR><BR>&#039; set other fields if necessary <BR>rs.Update <BR>%&#062; <BR><BR> <BR>Notice that the Binary property enables us to assign a file to a recordset field much the same way as any numeric or text value. A similar approach can be taken in order to pass a file as a parameter to a transactional SQL stored procedure as demonstrated by the code sample StoredProcedure.asp. The SP itself can be found in the sub-directory DatabaseMyStoredProc.sql."<BR><BR>This is exactly what I want, however ASPUpload 3.0 is now obsolete. I cant find it. If someone has it can they please send me those two files (the sproc, and the asp file) to my email:<BR><BR>If you know how to do this can you also please help<BR>THanks a million<BR><BR>Mike M

  2. #2
    Join Date
    Dec 1969

    Default Personally I don't use

    ASPUpload, but you can pass a binary value like this<BR><BR>------ <BR>CREATE PROCEDURE spInsertImage<BR>@ImageName INT,<BR>@Image IMAGE<BR><BR>AS<BR><BR>INSERT INTO ImagesTable (Title,ImageFile) VALUES (@ImageName,@Image)<BR><BR>-----<BR><BR>Call the proc like this<BR><BR>MyConnection.Execute ("spInsertImage &#039;" & Upload.FileName & "," & Upload.Binary<BR><BR>(not sure about the .FileName property)

Posting Permissions

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