Scusate ma non mi sono spiegato... posto il codice per essere piu chiaro:
ho una pagina dalla quale faccio un upload di alcuni dati e di alcune immagini.
I dati e le immagini funzionano alla grande, il problema mi si pone quando devo caricare sul database le opzioni(checkboox)..
Se l'utente mette la spunta allora devo caricare "si.jpg" altrimenti devo caricare "no.jpg"



scheda_nuovo_utente.htm
codice:
<form action="upload.asp" method="post" enctype="multipart/form-data">
  <div align="center">
    <center>
  <table width="386" border="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="2" height="488">
    <tr> 
      <td width="101" height="19"></td>
      <td width="277" height="19"></td>
    </tr>
    <tr> 
      <td width="101" height="24"><font face="Arial Narrow" size="2">Cognome</font></td>
      <td width="277" height="24">
      <input name="cognome" type="text" id="cognome" style="border-style: solid; border-width: 1" size="15"></td>
    </tr>
    <tr> 
      <td width="101" height="24"><font face="Arial Narrow" size="2">Nome</font></td>
      <td width="277" height="24">
      <input name="nome" type="text" id="nome" style="border-style: solid; border-width: 1" size="15"></td>
    </tr>
    <tr> 
      <td width="101" height="24"><font face="Arial Narrow" size="2">Citta</font></td>
      <td width="277" height="24">
      <input name="citta" type="text" id="citta" size="15" style="border-style: solid; border-width: 1"></td>
    </tr>
    <tr> 
      <td width="101" height="19"></td>
      <td width="277" height="19"></td>
    </tr>
    <tr> 
      <td width="101" height="21"><font face="Arial Narrow" size="2">opzione 01</font></td>
      <td width="277" height="21">
      <input type="checkbox" name="opzione01" value="si.gif"></td>
    </tr>
    <tr> 
      <td width="101" height="19"><font face="Arial Narrow" size="2">opzione 02</font></td>
      <td width="277" height="19">
      <input type="checkbox" name="opzione02" value="si.gif"></td>
    </tr>
    <tr> 
      <td width="101" height="19"><font face="Arial Narrow" size="2">opzione 03</font></td>
      <td width="277" height="19">
      <input type="checkbox" name="opzione03" value="si.gif"></td>
    </tr>
    <tr> 
          <td width="101" height="20"></td>
      <td width="277" height="20">
      </td>
    </tr>
    <tr> 
          <td width="101" height="20"><font face="Arial Narrow" size="2">foto 01:</font></td>
      <td width="277" height="20">
      <input type="file" name="file1" size="18" style="border-style: solid; border-width: 1"></td>
    </tr>
    <tr> 
      <td width="101" height="20"><font face="Arial Narrow" size="2">foto 02:</font></td>
      <td width="277" height="20"><input name="file2" type="file" id="file2" style="border-style: solid; border-width: 1" size="18"></td>
    </tr>
    <tr> 
      <td width="101" height="24"></td>
      <td width="277" height="24"></td>
    </tr>
    <tr> 
      <td width="101" height="19"></td>
      <td width="277" height="19">
          <input name="submit" type="submit" value="   Invia   " style="border-style: solid; border-width: 1"></td>
    </tr>
    </table>
    </center>
  </div>
  </form>





upload.asp
codice:
<%
'Questa variabile setta il percorso di dove effettuare l'upolad
	percorso = "/public/immagini/"
	
' Setto le variabili per la data
	miaData = Now

'Estrapolo il giorno
	gg = Day(miaData)

'Estrapolo il mese
	mm = Month(miaData)

'Estrapolo l'anno
	aa = Year(miaData)

'Estrapolo le ore
	h = Hour(miaData)

'Estrapolo i minuti
	m = Minute(miaData)

'Estrapolo i secondi
	s = Second(miaData)

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
		
		
'controllo i valori dei checkbox
		if instr(Intestazione,"opzione01") > 0 then
			opzione01 = ContenutoFile
		end if
		
		if instr(Intestazione,"opzione02") > 0 then
			opzione02 = ContenutoFile
			
		end if
		
		if instr(Intestazione,"opzione03") > 0 then
			opzione03= 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 = gg & "-" & mm & "-" & aa & "-" & h & "-" & m & "-" & s & "-" & 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
			else
			image_path_file1 ="/public/immagini/nessuna_immagine.jpg" 
			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 = gg & "-" & mm & "-" & aa & "-" & h & "-" & m & "-" & s & "-" & 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
			else
			image_path_file2 ="/public/immagini/nessuna_immagine.jpg" 
			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() 


if Upload1 = true Or Upload2 = true  then
	foto = "SI"
	sql = "INSERT INTO schede(cognome, nome, citta, path_immagine_file1, path_immagine_file2, foto,opzione01, opzione02, opzione03) VALUES( '"&cognome&"','"&nome&"','"&citta&"','"&image_path_file1&"','"&image_path_file2&"','"& foto &"','"& opzione01 &"','"& opzione02 &"','"& opzione03 &"')" 
response.write(sql)
else
	foto = "NO"
	sql = "INSERT INTO schede(cognome, nome, citta, path_immagine_file1, path_immagine_file2, foto,opzione01, opzione02, opzione03) VALUES( '"&cognome&"','"&nome&"','"&citta&"','"&image_path_file1&"','"&image_path_file2&"','"& foto &"','"& opzione01 &"','"& opzione02 &"','"& opzione03 &"')" 
response.write(sql)
end if

cn.execute(sql) 
cn.close() 
set cn = nothing 

'Verifico tutto l'upload effettuato
Response.Write "
Cognome: " & cognome & "
"
Response.Write "Nome: " & nome & "
"
Response.Write "Città: " & citta & "
"
Response.Write "Opzioni: 
"
Response.Write "Opzione 01: " & opzione01 & "
"
Response.Write "Opzione 02: " & opzione02 & "
"
Response.Write "Opzione 03: " & opzione03 & "
"


If Upload1 = true then
	Response.Write "
Il nome del file1 che hai uploadato è: " & NomeFile1 & "
"
	Response.Write "La dimensione è di " & DimensioneFile1*0.001 & "kb
"

End If

If Upload2 = true then
	Response.Write "
Il nome del file2 che hai uploadato è: " & NomeFile2 & "
"
	Response.Write "La dimensione è di " & DimensioneFile2*0.001 & "kb
"

End If
End If

%>