no se como implementar el javascript con multiples campos
mi script es el siguiente
Código PHP:
<%
'option explicit
Response.Expires = -1
Server.ScriptTimeout = 1000000
%>
<!-- #include file="arxius/freeaspupload.asp" -->
<%
' ****************************************************
' Cambiar el valor de la siguiente variable
' para indicar el directorio de destino.
' El directorio indicado debe tener permisos de escritura
' de caso contrario el script fallará mostrando un error.
Dim uploadsDirVar, carpeta_on, carpeta_pujar, estat
estat=request.QueryString("estat")
carpeta_on = request.QueryString("aon")
carpeta_pujar = carpeta_on
'uploadsDirVar =Server.MapPath("/upload")
uploadsDirVar =Server.MapPath(carpeta_pujar)
'uploadsDirVar = "imatges_productes/productes"
' ****************************************************
function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey, resumen
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
' If something fails inside the script, but the exception is handled
If Err.Number <> 0 then Exit function
SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
resumen = "<br /><br /><span class=""normal""><B>Arxius pujats:</B><br /> "
for each fileKey in Upload.UploadedFiles.keys
if (Right(Upload.UploadedFiles(fileKey).FileName, Len(Upload.UploadedFiles(fileKey).FileName)-(InStrRev(Upload.UploadedFiles(fileKey).FileName, ".")-1)) <> "pdf") then
resumen = "<br><br><br>El nom del fitxer especificat no es vàlid en el sistema."
else
end if
resumen = resumen & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) <br /> "
next
response.Write"</span>"
else
resumen = "<br><br><br>El nom del fitxer especificat no es vàlid en el sistema."
end if
'comentar la siguiente linea si no se desea mostrar el resumen
SaveFiles = resumen
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script src="arxius/js.js"></script>
<HEAD>
<!--#include file="includes/titol.asp" -->
<link href="arxius/estils_admin.css" rel="stylesheet" type="text/css" />
</HEAD>
<BODY>
<br>
<span class="normal">Estas pujant arxius a <b><%=carpeta_pujar%></b></span>
<%if estat="pujat" then%>
<div id="form_puja" style='margin-left:150; display:none' >
<%else%>
<div id="form_puja" style='margin-left:150'>
<%end if%>
<form action="puja_pdf.asp?aon=<%=carpeta_on%>&estat=pujat" method="POST" enctype="multipart/form-data" name="frmSend" class="normal">
Arxiu 1:
<input name="attach1" type="file" size="35"><br>
Arxiu 2:
<input name="attach2" type="file" size="35"><br>
Arxiu 3:
<input name="attach3" type="file" size="35"><br>
Arxiu 4:
<input name="attach4" type="file" size="35"><br>
<br>
<input type=submit value="Puja" onClick="amagainfo('form_puja');verMasInfo('loading') ">
</form>
<BR></div>
<div id="loading" style="display:none">
<br /><br /><span class="normal"><img src="imatges_admin/loading.gif" alt="load" /> Pujant imatges espera!!!!</span><br /><br />
</div>
<%
'solo llamo al UPLOAD si hay envio de formulario
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
Hace el upload de los archivos enviados y muestra el resumen
response.write SaveFiles()
end if
%>