Originariamente inviato da Mems
Ti prepari delle immagini rappresentanti i file doc, pdf, etc.
Ad esempio: doc.gif, pdf..gif, etc.
Poi leggi l'estenzione del file e lo metti come nome del file immagine da caricare.
codice:
<%
file = "pippo.doc"
ext = right(file,3)
%>
[img]<%=ext%>.gif[/img]
Il campo BLOB già salva il nome del file...
Quindi se io mettessi
codice:
<%
Set Con = Server.CreateObject( "ADODB.Connection" )
Con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&SERVER.MAPPATH("/mdb-database/gruppiSicilia.mdb")
sql = "SELECT * FROM TabellaGruppi"
set rs = con.execute(sql)
estensione = "=rs('blob')"
ext = right(estensione,3)
%>
E poi inserissi:
codice:
<%
if not rs.eof then
do until rs.eof
%>
<%
if estensione = "pdf" then%>
[img]gfx/pdf.gif[/img]
<%elseif estensione = "jpg" then%>
[img]gfx/jpg.gif[/img]
<%elseif estensione = "doc" then%>
[img]gfx/doc.gif[/img]
%>
<tr>
<td width="100" rowspan="3">" target="_blank">[img]<%=rs([/img].gif" border="0"></td>
<%
end if
%>
<td width="50" rowspan="3">[img]../gfx/trasp1px.gif[/img]</td>
<td class="ContenutiROSSO"><div align="center"><%=rs("titoloGruppi")%></div></td>
</tr>
<tr>
<td>[img]../gfx/trasp1px.gif[/img]</td>
</tr>
<tr>
<td class="ContenutiBLU"><div align="left"><%=rs("descrizioneGruppi")%></div></td>
</tr>
<tr>
<td colspan="3">[img]../gfx/trasp1px.gif[/img]</td>
</tr>
<%
rs.moveNext
loop
end if
rs.close
set rs = nothing
con.close
set con = nothing
%>
Potrebbe andare?