Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 18

Discussione: directory

  1. #1

    directory

    Ciao.
    Vorrei sapere se è possibile leggere una directory sul server del sito e utilizzare i nomi dei file (magari in variabili) x aggiungerli ai link di una pagina in modo da far aprire quel file.
    Non so se mi spiego!
    In poke parole ho molti file mp3 e devo creare tanti link x poterli far ascoltare o scaricare.
    Vi riangrazio

  2. #2
    Prova a dare un occhiata a questo esempio: http://www.asp101.com/samples/dir_list.asp

    Ciau!
    - Dean

  3. #3
    grazie mille proprio così mi serviva ma nn riesco a visualizzarlo sul mio sito. sai dirmi come mai?

  4. #4
    Originariamente inviato da gant85
    grazie mille proprio così mi serviva ma nn riesco a visualizzarlo sul mio sito. sai dirmi come mai?
    La palla di vetro l'abbiamo in officina oggi...
    Ci dici che errore ti da?
    Cosa appare sul browser?

  5. #5

    mi scrive IMPOSSIBILE VISUALIZZARE LA PAGINA

    QST è IL LINK
    http://www.gemmedigrazia.com/dir_list_recursive.asp

  6. #6
    Dalle opzioni avanzate di explorer devi TOGLIERE la spunta dalla voce Mostra messaggi di errore HTTP brevi.
    Comunque l'errore è questo:
    Microsoft VBScript runtime error '800a004c'

    Path not found

    /dir_list_recursive.asp, line 30

    Facci vedere il tuo codice.

  7. #7
    Questo è il codice..... ti ringrazio


    <%
    ' I still like the idea of locking the script down somewhat
    ' so I've added the idea of a root path which is the level
    ' above which the script will not show folder contents.
    Const strRootPath = "dir"

    Dim strThisPage ' This page's relative URL
    Dim strPath ' Path of directory to show
    Dim strFullPath ' strRootPath & strPath
    Dim objFSO ' FileSystemObject
    Dim objFolder ' Folder
    Dim objItem ' Looping variable

    ' Set the URL of this script to a variable so we don't
    ' have to keep looking it up.
    strThisPage = Request.ServerVariables("URL")

    ' Read the subfolder to show from the querystring.
    strPath = Request.QueryString("path")

    ' Check to make sure no one is trying to escape our root path.
    If InStr(1, strPath, ".", 1) <> 0 Then strPath = ""
    If InStr(1, strPath, Server.URLEncode("."), 1) <> 0 Then strPath = ""

    ' Simply to save typing and computation later.
    strFullPath = strRootPath & strPath

    ' Create our FSO and get a handle on our folder
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(Server.MapPath(strFullPath))

    ' Show a description line and the title row of our table
    %>



    Contents of <%= strFullPath %>
    </p>

    <table border="1" cellspacing="0" cellpadding="2">
    <tr>
    <th>File Name:</th>
    <th>File Size:</th>
    <th>Date Created:</th>
    <th>File Type:</th>
    </tr>
    <%

    ' First deal with any subdirectories. This is where the recursive
    ' script varies from the normal one. Take a look at how we build
    ' the link URLs.

    ' Show a link to the parent folder is applicable.
    If strFullPath <> strRootPath Then
    %>
    <tr>
    <td>">..</td>
    <td></td>
    <td></td>
    <td></td>
    </tr>
    <%
    End If

    ' Show a link for each folder. The link calls this script again
    ' and passes it the path to the folder clicked upon.
    For Each objItem In objFolder.SubFolders
    ' Deal with the stupid VTI's that keep giving our visitors 404's
    If InStr(1, objItem, "_vti", 1) = 0 Then
    %>
    <tr>
    <td>"><%= objItem.Name %></td>
    <td align="right"><%= objItem.Size %></td>
    <td><%= objItem.DateCreated %></td>
    <td><%= objItem.Type %></td>
    </tr>
    <%
    End If
    Next 'objItem

    ' Now that I've done the SubFolders, do the files!
    For Each objItem In objFolder.Files
    %>
    <tr>
    <td>"><%= objItem.Name %></td>
    <td align="right"><%= objItem.Size %></td>
    <td><%= objItem.DateCreated %></td>
    <td><%= objItem.Type %></td>
    </TR>
    <%
    Next 'objItem

    ' All done! Kill off our object variables.
    Set objItem = Nothing
    Set objFolder = Nothing
    Set objFSO = Nothing
    %>
    </table>

  8. #8
    Dentro al sito qual'è il percorso della cartella da leggere?

  9. #9
    http://www.gemmedigrazia.com/bibbia/...otestamento/01 Genesi/

    questo è il link. sono file mp3. sarebbe la bibbia letta! ti ringrazio

  10. #10
    questo è uno dei file se ti interessa

    Genesi (1).mp3

    va in progressione

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.