Hola Adler
El Sub que tengo dentro del xelupload.asp ahora mismo es este:
Código asp:
Ver originalPublic Sub ListFolderContents(path)
dim objFSO, objFolder, colfiles
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(path)
Set colFiles = objFolder.Files
'Muestro la info de la carpeta (si quiero)
'Response.Write("<li><b>" & folder.Name & "</b> - " _
' & folder.Files.Count & " files, ")
'Response.Write(Round(folder.Size / 1024) & " KB total." _
' & vbCrLf)
'nothing there.. print
if colFiles.Count = 0 then
Response.Write "<table border=""0"""&_
"cellspacing=""1"" cellpadding=""2"""&_
"><tr><td>Este archivo no se ha subido.</td></tr></table>"
else
' Response.Write("" & vbCrLf)
'Display a list of sub folders.
For Each objFile in colFiles
ListFolderContents(item.Path)
next
'Display a list of files.
Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""2"">"&_
"<tr>"&_
"<td>Nombre del archivo</td>"&_
"<td>Tamaño</td>"&_
"<td>Contenido</td>"&_
"<td>Fecha de Modificacion</td>"&_
"<td>Borrar</td>"&_
"</tr></table>"
end if
end sub
Y también he puesto: ListFolderContents(Server.MapPath("caratulas")) como me has indicado pero de momento sigue dandome el mismo error si intento subir el archivo: No coinciden los tipos: 'ListFolderContents' y si no subo ningún archivo ni edito nada: Se requiere un objeto: '[undefined]'
El Sub contenía la función que me dió Shiryu_Libra modificada com Public Sub:
Código asp:
Ver originalPublic sub ListFolderContents(path)
dim fs, folder, file, item, url
set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
'Muestro la info de la carpeta (si quiero)
'Response.Write("<li><b>" & folder.Name & "</b> - " _
' & folder.Files.Count & " files, ")
'Response.Write(Round(folder.Size / 1024) & " KB total." _
' & vbCrLf)
'nothing there.. print
if folder.Files.Count = 0 then
Response.Write "<table border=""0"""&_
"cellspacing=""1"" cellpadding=""2"""&_
"><tr><td>Este archivo no se ha subido.</td></tr></table>"
else
' Response.Write("" & vbCrLf)
'Display a list of sub folders.
for each item in folder.SubFolders
ListFolderContents(item.Path)
next
'Display a list of files.
Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""2"">"&_
"<tr>"&_
"<td>Nombre del archivo</td>"&_
"<td>Tamaño</td>"&_
"<td>Contenido</td>"&_
"<td>Fecha de Modificacion</td>"&_
"<td>Borrar</td>"&_
"</tr></table>" '"Attributes,DateCreated,DateLastAccessed,DateLastModified,Drive,Name,ParentFolder,Path,ShortName,ShortPath,Size,Type"
response.Write "<table>"
for each item in folder.Files
if fs.GetExtensionName(item)="txt" then
url = MapURL(item.path)
nami = item.name
getDeleteLink = Server.Urlencode(item.name)
Response.Write "<tr><td><a href="&_
unescape(url) & " target=_blank>" &_
item.Name & "</a></td><td>" &_
item.Size & " (Bytes)</td>" &_
"<td>" & leer(fs,item) & "</td>"&_
"<td>" & dateValue(item.DateLastModified) & "</td>"&_
"<td><a href=" & pagina & "?file=" &_
unescape(getDeleteLink) & "> Delete this file </a>" &_
"</td></tr>"'<br />"
end if
next
Response.Write("</table>")
end if
end sub