Bonjour à tous,
Pour uploader un fichier se trouvant chez un client, j'ai fait cette page qui uploader le fichier et le placer dans un dossier crée et nommé par une variable récupéré.
Maintenant, je veux placer le fichier dans un sous-dossier nommé selon le type de fichier choisi, donc j'ai ajouté:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 <html> <head> <title>Upload de fichier</title> </head> <body> <form method=post ENCTYPE="multipart/form-data"> Fichier : <input name="File1" type="file"> <br> <input Name="Action" type="submit" value="Ajouter le fichier"> </p> </form> </body></HTML> <!---#INCLUDE FILE="upload.inc" ---> <% '--dossier est une variable dont on récupere la valeur d'une autre page dossier=Request.QueryString("dossier") Set FSO =Server.CreateObject("Scripting.FileSystemObject") if FSO.FolderExists(Server.MapPath("../Projets/"&dossier))=false then FSO.CreateFolder(Server.MapPath("../Projets/"&dossier)) end if %> <% If Request.ServerVariables("REQUEST_METHOD") = "POST" Then Set Fields = GetUpload() FilePath = Server.MapPath("..\Projets\"&dossier) & "\" & Fields("File1").FileName Fields("File1").Value.SaveAs FilePath End If %>
Comment modifier mon code pour creer ce sous-dossier?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 type: <select name="type"> <option value="type1">Type 1</option> <option value="type2">Type 2</option> <option value="type3">Type 3</option> </select>
J'ai essayé mais je ne trouve pas la solution.
Et merci d'avance.
Partager