<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!-- #include file="connections.asp" -->
<%
if session("User_azienda")="" then
response.Redirect("pannellologinErr.asp")
end if
%>
<%
if request.Form("elimina")="Y" then
if isnumeric(request.Form("ide")) and request.Form("ide")<>"" then
set eliminaEV=server.CreateObject("adodb.command")
eliminaEV.activeconnection=mm_portale_string
eliminaEV.commandtext="DELETE FROM eventi where ID="&clng(replace(request.Form("ide"),"'","''"))
eliminaEV.execute()
eliminaEV.activeconnection.close()
dim fso
dim file
dim lista_files
set fso = Server.CreateObject("Scripting.FileSystemObject")
file = server.MapPath("/public/aziende/eventi/" & session("User_azienda") & "/propriEventi")
if fso.folderExists(file) then
dim singolofile
set fotos=fso.GetFolder(file)
for each x in fotos.files
if instr(x.Name,request.form("ide") & "_") > 0 then
singolofile=server.MapPath("/public/aziende/eventi/" & session("User_azienda") & "/propriEventi/" & x.Name)
lista_files=lista_files & "/public/aziende/eventi/" & session("User_azienda") & "/propriEventi/" & x.Name & "<br />"
fso.Deletefile(singolofile)
end if
next
end if
Set fso=nothing
mex="<hr><h3>Eliminazione avvenuta con successo, ho eliminato anche i seguenti files: </h3>" & lista_files
else
mex="Eliminazione non riuscita."
end if
end if
set eventi=server.CreateObject("adodb.recordset")
eventi.activeconnection=MM_portale_STRING
eventi.source="select * from eventi where idazienda="&clng(replace(session("User_azienda")," '","''"))&" order by data"
eventi.open()
%>
<%
set fso = Server.CreateObject("Scripting.FileSystemObject")
file = server.MapPath("/public/aziende/eventi/" & eventi("idazienda") & "/propriEventi/")
if fso.folderExists(file) then
set fotos=fso.GetFolder(file)
for each x in fotos.files
if instr(x.Name,eventi("id") & "_") > 0 then
%>
<img id="img_rid" src='public/aziende/eventi/<%= eventi("idazienda")%>/propriEventi/<%=x.name%>' width="80" />
<%
end if
next
end if
Set fso=nothing
%>
Cerco di essere concreto: come si evince da script faccio queste cose
1) inserisco eventi nel data-base testo
2) inserisco le immagini percorso public/ e non nel data-base
3) creo la folder al volo
4) mi ci infila dentro il file
QUI NASCE IL PROBLEMA
IL PROBLEMA è IL SEGUENTE:
L'ATTUALE SCRIPT CREA I RECORD IN SEGUENZA COME E' NORMALE CHE SIA, PERO' METTIAMO CHE IO ABBIA
RECORD N. 27 = IMMAGINE N. 27.1 N. 27.2 ECC.ECC.
RECORD N. 127 = IMMAGINE N.127.1 N. 127.2 ECC.ECC
A QUESTO PUNTO IL PERCORSO
<img id="img_rid" src='public/aziende/eventi/<%= eventi("idazienda")%>/propriEventi/<%=x.name%>' width="80" />
MI LEGGE TUTTO CIO' CHE E' 27 LE IMMAGINI SI INTERFACCIANO A VIDEO SU ENTRAMBI I RECORD
ANCHE SE FACCIO IN MODO CHE VENGANO
RINOMINATE 027.1 OPPURE 0127.1
STO SBATTENDO LA TESTA AL MURO, SE SERVE POSTO ANCHE IL FILE UPLOAD
AIUTOOOOOOOOOOOO!!!!!

Rispondi quotando
