IAORANA
[font=Lucida
Bonjour
Je suis entrain de tester un Upload sans composant, le pb ca ne fonctionne pas.
Voici le prog
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim contenu, taillecontenu, x, y, z, position, content
contenu=Request.BinaryRead(Request.TotalBytes)
%><br>eeeeeeeeeeeeeeecontent = <%
response.BinaryWrite(contenu)
%><br>contenu = <%=contenu%><%
content=cstr(contenu)
%><br>content = <%=content%><%
taillecontenu=Request.TotalBytes
%><br>taillecontenu = <%=taillecontenu%><%
%><br>1 = <%%><%
Dim toutok
toutok = 0
%><br>2 = <%%><%
Dim posdebutfic, posfinfic, posdebutcont, posfincont, posdebutfic2, posfinfic2
posdebutfic=0
posfinfic=0
posdebutcont = 0
posfincont = 0
posdebutfic2 = 0
posfinfic2 = 0
x = 0
y = 0
position = 1
%><br>3 = <%%><%
dim limitascii
limitascii = "filename=" & chr(34)
%><br>limitascii = <%=limitascii%><%
%><br>len(limitascii) = <%=len(limitascii)%><%
%><br>4 = <%%><%
dim limitbin
limitbin = ""
%><br>5 = <%%><%
for z = 1 to Len(limitascii)
limitbin = limitbin & chr (ASC(Mid(limitascii, z, 1)))
next
%><br>limitbin = <%=limitbin%><%
%><br>6 = <%%><%
posdebutfic = Instr(1, contenu, limitbin)
%><br>posdebutfic = <%=posdebutfic%><%
if posdebutfic <> 0 then
%><br>6b = <%%><%
posdebutfic = posdebutfic + len(limitbin)
end if
%><br>posdebutfic = <%=posdebutfic%><%
%><br>7 = <%%><%
limitascii = "Content-Type:"
limitbin = ""
for z = 1 to len(limitascii)
limitbin = limitbin & chr(ASC(Mid(limitascii, z, 1)))
next
%><br>limitbin = <%=limitbin%><%
%><br>8 = <%%><%
posdebutcont = Instr(1, contenu, limitbin)
if posdebutcont <> 0 then
%><br>8b = <%%><%
posfinfic = posdebutcont - 3
posdebutcont = posdebutcont + Len(limitbin)
end if
%><br>posdebutcont = <%=posdebutcont%><%
%><br>9 = <%%><%
Dim nomfichier, resultat
resultat = posfinfic - posdebutfic
%><br>resultat = <%=resultat%><%
%><br>posfinfic = <%=posfinfic%><%
%><br>posdebutfic = <%=posdebutfic%><%
nomfichier = Mid(contenu, posdebutfic, resultat)
%><br>10 = <%%><%
Dim contenuascii
contenuascii = ""
for z = 1 to len(nomfichier)
contenuascii = contenuascii & chr(ASC(Mid(nomfichier, z, 1)))
next
%><br>11 = <%%><%
nomfichier = contenuascii
posfincont = Instr(posdebutcont, contenu, chr(13))
if posfincont <> 0 then
posdebutfic2 = posfincont + 4
end if
%><br>12 = <%%><%
limitascii = "----"
limitbin = ""
for z = 1 to len(limitascii)
limitbin = limitbin & chr(asc(mid(limitascii, z, 1)))
next
%><br>13 = <%%><%
posfinfic2 = instr(posdebutfic2, contenu, limitbin)
if posfinfic2 <> 0 then
toutok = 1
end if
%><br>14 = <%%><%
dim datafichier, nomfichiercourt, nouveaufic, fileobject, out, i
datafichier = mid(contenu, posdebutfic2, (posfinfic2 - posdebutfic))
%><br>15 = <%%><%
if toutok = 1 then
position = InstrRev(nomficher, "\")
%><br>16 = <%%><%
nomfichiercourt = right(nomfichier, (len(nomfichier) - position))
%><br>17 = <%%><%
nouveaufic = Server.MapPath("\") & "\" & nomfichiercourt
%><br>18 = <%%><%
set fileobject = Server.CreateObject("Scripting.FileSystemObject")
%><br>19 = <%%><%
set out = fileobject.CreateTextFile(nouveaufic, true)
%><br>20 = <%%><%
for i = 1 to len(dataficher,i,1)
Out.Write chr(asc(mid(datafichier,i,1)))
%><br>21 = <%
next
out.close
set out = nothing
end if
%>
je l'ai pris sur un forum
le pb à contenu il n''y a que des ?????? j'ai fait un response.BinaryWrite(contenu) et là c'est ok, mais le pb quand il passe dans
nomficher=mid(contenu,posdebutfic,resultat) alors contenu = ????etc , posdebutfic=0 et resultat=0, aurais tu une idée sur le blême ou un autre upload sans composant qui fonctionne, je travaille en asp 3 et vbscript et je débute dans cet environnement.
J'apprecierai bien un coup de main
Merci