Voice upload (2)

xiaoxiao2021-03-06  65

Table Sound Field ID Numeric 9 (Self-increment) WAV Image 16 WAVINFO VARCHAR 50 WAVSIZE NUMERIC Save.asp 'Write the Sound File to Database

<% @ Language = vbscript%> <% response.expires = 0 Server.scripttimeout = 3600 call main ()

Sub main ()

Formsize = request.totalBytesformData = request.binaryRead (Formsize)

Bncrlf = chrb (13) & chrb (10) Divider = Leftb (Formdata, Instrb (Formdata, Bncrlf) -1) Datastart = INSTRB (FormData, Bncrlf & Bncrlf) 4 DataEnd = INSTRB (Datastart 1, Formdata, Divider) -Datastart

WAV = WAVUP (Formsize, Formdata)

StrtXT = MID (Formdata, Instr (WAV) LEN (WAV) 1) Strtxt = Bin2Str (Strtxt)

'Wavinfo = Findvar ("WAVINFO", Strtxt)

SET RS = Server.createObject ("AdoDb.Recordset") SQL = "SELECT WAV, WAVSIZE, WAVINFO from Sound" RS.Open SQL, CONN, 1, 3

Rs.addNewRS ("WAVINFO") = WAVINFORS ("WAVSIZE") = DataEnd-2if Len (WAV)> 1 THEN RS ("WAV"). Appendchunk WAV end ifrs.Update Rs.close Set RS = NothingConnCloseet CONN = Nothing'Response.write ("remote_addr")) response.write ("