aspSmartUpload error '800a0009'
Bonjour,
J'essaye de faire un Upload, mais j'ai le message suivant :
Citation:
aspSmartUpload error '800a0009'
Subscript out of range
/Nouveaux site/Pages/Modif_AvatarEssai.asp, line 40
ma ligne 40 correspond à
Citation:
<%mySmartUpload.Upload%>
Pourtant dans mon formulaire j'ai bien enctype="multipart/form-data"
Voici mon code complet
Code:
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
<form method="post" enctype="multipart/form-data">
<input type="file" name="userfile"> <br>
<input type="submit" value="Enregistrer le fichier">
</form>
<% Set mySmartUpload = _
Server.CreateObject("aspSmartUpload.SmartUpload")%>
<%mySmartUpload.MaxFileSize = 1024%>
<%mySmartUpload.Upload%>
<%intCount = mySmartUpload.Save(rep)%>
<%if err then response.write err.description%>
<% For each file In mySmartUpload.Files %>
<br> Nom : <%=file.FileName%>
<br> Taille : <%=file.Size%> octets
<br> Type : <%=file.ContentType%>
<% next %>
<%
On Error Resume Next
MFS=1024
rep="/data/upload"
Set mySmartUpload = _
Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.MaxFileSize = MFS
mySmartUpload.Upload
intCount = mySmartUpload.Save(rep)
if err = -2147220399 then
%>
<b>Trop gros fichier !</b>
<i>( <%=MFS%> octets max.)</i>
<% elseif intCount>0 then %>
<b>Votre fichier à bien été enregistré !</b>
<% For each file In mySmartUpload.Files %>
<br> Nom : <%=file.FileName%>
<br> Taille : <%=file.Size%> octets
<br> Type : <%=file.ContentType%>
<% next
elseif err <> 9 then %>
<b>Erreur d'enregistrement !</b>
<%=err.description%>
<% End if %>
<br>
LISTE*DES*FICHIERS*TELECHARGES
<BR>
<table>
<% Set FSO = _
Server.CreateObject("Scripting.FileSystemObject")
set fc = FSO.GetFolder(server.MapPath(rep)).Files
for each f in fc %>
<tr></tr>
***<TR>
<th>
<a href="<%=rep&"/"&f.name%>" target="_blank"><%=f.name%></a>
</th>
<td align="right"><%=f.size%></td>
<td><%=f.dateCreated%></td>******
</tr>
<% next %>
</table> |
Merci d'avance
Cédric.