![]()
![]()
![]()
NON è POSSIBILE
La variabile della riga rossa ok quella blu che fine fa?
codice:<% percorso = "/public/immagini/" ByteRicevuti = Request.TotalBytes if ByteRicevuti > 0 then DatiRicevuti = Request.BinaryRead(ByteRicevuti) For i = 1 To lenB(DatiRicevuti) FileBinario = FileBinario & chr(ascB(midB(DatiRicevuti,i,1))) Next FirmaFile = left(FileBinario,instr(FileBinario,"" & vbCrLf)-1) ArrPezzi = split(FileBinario,FirmaFile) for item = 1 to ubound(ArrPezzi)-1 Inizio = instr(ArrPezzi(item),"" & vbCrLf & "" & vbCrLf) Intestazione = left(ArrPezzi(item),Inizio-1) Inizio = Inizio + len("" & vbCrLf) + len("" & vbCrLf) ContenutoFile = mid(ArrPezzi(item),Inizio,len(ArrPezzi(item))-Inizio-1) ' Recupero i campi se sono compilati if instr(Intestazione,"cognome") > 0 then cognome = ContenutoFile end if if instr(Intestazione,"nome") > 0 then nome = ContenutoFile end if if instr(Intestazione,"citta") > 0 then citta = ContenutoFile end if if instr(Intestazione,"provincia") > 0 then provincia = ContenutoFile end if if instr(Intestazione,"email") > 0 then email = ContenutoFile end if if instr(Intestazione,"sesso") > 0 then sesso = ContenutoFile end if if instr(Intestazione,"eta") > 0 then eta = ContenutoFile end if if instr(Intestazione,"descrizione") > 0 then descrizione = ContenutoFile end if if instr(Intestazione,"aspettative") > 0 then aspettative = ContenutoFile end if ' Qui recupero il file da uploadare (se presente) e lo scrivo ' sul server if instr(Intestazione,"file1") > 0 then i = instr(Intestazione,"filename=") j = instr(i + 10,Intestazione,chr(34)) NomeUpload = mid(Intestazione,i + 10,j-i-10) i = instrRev(NomeUpload,"\") if i<>0 then NomeFile = mid(NomeUpload,i + 1) else NomeFile = NomeUpload end if if i<>0 then Set FSO = CreateObject("Scripting.FileSystemObject") Upload1 = True DimensioneFile1 = len(ContenutoFile) EstensioneFile1 = right(ContenutoFile,3) NomeFile1 = NomeFile image_path_file1 ="/public/immagini/" & NomeFile1 Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile1), True, False) textStream.Write ContenutoFile textStream.Close Set textStream = Nothing Set FSO = Nothing end if end if if instr(Intestazione,"file2") > 0 then i = instr(Intestazione,"filename = ") j = instr(i + 10,Intestazione,chr(34)) NomeUpload = mid(Intestazione,i + 10,j-i-10) i = instrRev(NomeUpload,"\") if i<>0 then NomeFile = mid(NomeUpload,i + 1) else NomeFile = NomeUpload end if if i<>0 then Set FSO = CreateObject("Scripting.FileSystemObject") Upload2 = True DimensioneFile2 = len(ContenutoFile) EstensioneFile2 = right(ContenutoFile,3) NomeFile2 = NomeFile image_path_file2 ="/public/immagini/" & NomeFile2 Set textStream = FSO.CreateTextFile(server.mappath(percorso & NomeFile2), True, False) textStream.Write ContenutoFile textStream.Close Set textStream = Nothing Set FSO = Nothing end if end if next dim cn, sql set cn = Server.CreateObject("ADODB.Connection") cn.connectionstring = "Provider=Microsoft.Jet.OLEDB.4.0;"&_ "Persist Security Info=False;"&_ "Data Source="& Server.MapPath("/mdb-database/db_utenti.mdb") cn.open() sql = "INSERT INTO schede(cognome, nome, sesso, citta, email, descrizione, aspettative, provincia, path_immagine_file1, path_immagine_file2) VALUES( '"&cognome&"','"&nome&"', '"&sesso&"', '"&citta&"' , '"&email&"', '"&descrizione&"' , '"&aspettative&"','"&provincia&"','"&image_path_file1&"','"&image_path_file2&"')" cn.execute(sql) cn.close() set cn = nothing response.write (image_path_file1) response.write ("-") response.write (image_path_file2) Response.Write (" ") response.write(sql) %>
codice:/public/immagini/ee.jpg- INSERT INTO schede(cognome, nome, sesso, citta, email, descrizione, aspettative, provincia, path_immagine_file1, path_immagine_file2) VALUES( 'p','p', 'sesso', 'p' , 'p', 'p' , 'p','PA','/public/immagini/ee.jpg','')

Rispondi quotando
