Bonjour, voila mon pb, j'ai 3 pages qui me permettent de lister le contenu d'un dossier et de supprimer un fichier choisit dans ce dossier. Malheureusement cela me supprime toujours le premier fichier et non pas celui que j'ai choisit.
Je laisse le code de mes trois pages et si qq à la solution elle sera la bienvenue.
- page 1 ChoixSup.asp :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Set FSO = _
Server.CreateObject("Scripting.FileSystemObject") %>
<% dir = Server.MapPath("../bibliotheques/Images/") %>
<% set foldPt = FSO.GetFolder(dir) %>
<% set fc = foldPt.Files %>
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0">
<tr>
<td>
<table width="400" border="0" align="center">
<tr>
<td><font size="2"><strong><font color="#0000FF">Choississez l'image
que vous voulez supprimer dans la liste ci-dessous puis cliquez sur
le bouton "Supprimer" correspondant.</font><br>
<font color="#FF0000">
<div align="center">Attention une suppression est définitive.</div>
</font></strong></font></td>
</tr>
<tr>
<td><% for each f in fc %> <form name="form1" method="post" action="Sup.asp">
<table border="0" cellspacing="4">
<tr>
<td><input type="submit" name="Submit" value="SUP"></td>
<td> <%=f.name%> </td>
<td> Mise en place le <%=f.DateLastModified%> </td>
</tr>
</table>
</form>
<% next%></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
- page 2 Sup.asp :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Set FSO = _
Server.CreateObject("Scripting.FileSystemObject") %>
<% dir = Server.MapPath("../bibliotheques/Images/") %>
<% set foldPt = FSO.GetFolder(dir) %>
<% set fc = foldPt.Files %>
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="0;url=SupVerif.asp">
</head>
<body>
<% for each f in fc %>
<a href"#" onClick="<%f.delete%><%=f.name%>"><%=f.name%></a><br>
<% next%>
</body>
</html>
- page 3 SupVerif.asp :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% Set FSO = _
Server.CreateObject("Scripting.FileSystemObject") %>
<% dir = Server.MapPath("../bibliotheques/Images/") %>
<% set foldPt = FSO.GetFolder(dir) %>
<% set fc = foldPt.Files %>
<html>
<head>
<title>Document sans titre</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="100%" border="0">
<tr>
<td><table width="400" border="0" align="center">
<tr>
<td colspan="3"><div align="center"><font size="3"><strong><font color="#0000FF">Images
existantes sur le serveur</font></strong></font></div></td>
</tr>
<tr>
<td><strong><font size="2">Nom</font></strong></td>
<td><strong><font size="2">Taille</font></strong></td>
<td><strong><font size="2">Date de mise en place</font></strong></td>
</tr>
<% for each f in fc %>
<tr>
<td><font size="1"><%=f.name%></font></td>
<td><font size="1"><%=f.size%></font></td>
<td><font size="1"><%=f.DateLastModified%></font></td>
</tr>
<%next%>
<tr align="center">
<td colspan="3"><a href="ChoixSup.asp">Retour à la page de suppression</a></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
LCVD