Ver Mensaje Individual
  #14 (permalink)  
Antiguo 21/12/2008, 21:46
Avatar de Shiryu_Libra
Shiryu_Libra
Colaborador
 
Fecha de Ingreso: febrero-2007
Ubicación: Cantando "Screenager" en "Kirafa Kaput"
Mensajes: 3.614
Antigüedad: 18 años, 1 mes
Puntos: 88
Respuesta: asp subir archivos o foto

Cita:
Iniciado por haga41 Ver Mensaje
Hola Shiryu_Libra,


Cita:
Iniciado por haga41 Ver Mensaje
De todas formas no se si será por como es mi xelupload o por que pero el FSo que comentas en mi archivo de xelpuload aparece en: Public Sub Guardar(ruta) y en Public Sub GuardarComo(nombrefichero, ruta). Es decir que el Fso comprueba el archivo justo antes de guardarlo en la carpeta correspondiente.
podrias utilizar el guardarcomo, para renombrarlo directamente, ya que este te da la oportunidad de renombrarlo en el mismo procedimiento de carga del archivo
Cita:
Iniciado por haga41 Ver Mensaje
Cuando dices "3.- despliegas mediante FSO los archivos" ¿a qué te refieres exactamente? Esa parte no la he entendido bien.
.... una funcion sencillita seria asi
Código ASP:
Ver original
  1. sub ListFolderContents(path)
  2.     dim fs, folder, file, item, url
  3.     set fs = CreateObject("Scripting.FileSystemObject")
  4.     set folder = fs.GetFolder(path)
  5.     'Muestro la info de la carpeta (si quiero)
  6.     'Response.Write("<li><b>" & folder.Name & "</b> - " _
  7.     ' & folder.Files.Count & " files, ")
  8.     'Response.Write(Round(folder.Size / 1024) & " KB total." _
  9.     ' & vbCrLf)
  10.     'nothing there.. print
  11.     if folder.Files.Count = 0 then
  12.         Response.Write    "<table border=""0"""&_
  13.                         "cellspacing=""1"" cellpadding=""2"""&_
  14.                         "><tr><td>Este archivo no se ha subido.</td></tr></table>"
  15.     else
  16.         '    Response.Write("" & vbCrLf)
  17.    
  18.  
  19.         'Display a list of sub folders.
  20.         for each item in folder.SubFolders
  21.             ListFolderContents(item.Path)
  22.         next
  23.         'Display a list of files.
  24.         Response.Write    "<table border=""0"" cellspacing=""1"" cellpadding=""2"">"&_
  25.                         "<tr>"&_
  26.                         "<td>Nombre del archivo</td>"&_
  27.                         "<td>Tamaño</td>"&_
  28.                         "<td>Contenido</td>"&_
  29.                         "<td>Fecha de Modificacion</td>"&_
  30.                         "<td>Borrar</td>"&_
  31.                         "</tr></table>"
  32.  
  33. '"Attributes,DateCreated,DateLastAccessed,DateLastModified,Drive,Name,ParentFolder,Path,ShortName,ShortPath,Size,Type"
  34.         response.Write "<table>"
  35.         for each item in folder.Files
  36.             if fs.GetExtensionName(item)="txt" then
  37.                 url = MapURL(item.path)
  38.                 nami = item.name
  39.                 getDeleteLink = Server.Urlencode(item.name)
  40.                 Response.Write    "<tr><td><a href="&_
  41.                                 unescape(url) & " target=_blank>" &_
  42.                                 item.Name & "</a></td><td>" &_
  43.                                 item.Size & " (Bytes)</td>" &_
  44.                                 "<td>" & leer(fs,item) & "</td>"&_
  45.                                 "<td>" & dateValue(item.DateLastModified) & "</td>"&_
  46.                                 "<td><a href=" & pagina & "?file=" &_
  47.                                 unescape(getDeleteLink) & "> Delete this file </a>" &_
  48.                                 "</td></tr>"'<br />"
  49.             end if
  50.         next
  51.         Response.Write("</table>")
  52.     end if
  53. end sub
Cita:
Iniciado por haga41 Ver Mensaje
Gracias por tu paciencia.
__________________
"Eres parte del problema, parte de la solucion o parte del paisaje"
Un Saludo desde Desierto de Altar, Sonora, MX.
Shiryu_libra