<% On Error Resume Next %> <% response.buffer = true %> <% Function ExtractDirName(byVal strFilename) ' Removes the directory from a string that contains path and filename If Len(strFilename) > 1 Then For I = 1 to 2 Dim X For X = Len(strFilename) To 1 Step -1 If Mid(strFilename, X, 1) = "/" Then Exit For Next If Len(strFilename) > 1 Then strFilename = Left(strFilename, X - 1) Else strFilename = "/" X = 2 End If Next ExtractDirName = Left(strFilename, X - 1) End If End Function Function ShowImageForType(strName) ' For the 'explorer': shows file-icons Dim strTemp strTemp = strName If strTemp <> "dir" Then strTemp = LCase(Right(strTemp, Len(strTemp) - InStrRev(strTemp, ".", -1, 1))) End If Select Case strTemp Case "asp", "aspx" strTemp = "asp" Case "dir" strTemp = "dir" Case "htm", "html" strTemp = "htm" Case "gif", "jpg" strTemp = "img" Case "txt" strTemp = "txt" Case Else strTemp = "misc" End Select strTemp = "" ShowImageForType = strTemp End Function Dim errorMessage function SaveFiles(PathToSaveTo) ' Saves potentially uploaded files - any errors are in errorMessage Dim Upload, fileName, fileSize, ks, i, fileKey Set Upload = New FreeASPUpload Upload.Save(PathToSaveTo) SaveFiles = "" end function %> <%' Now to the Runtime code: Dim strPath : strPath = "/so-content/uploads/yuklenenler/" 'Path of directory to show, default is root If Len(Request.QueryString("dirpath")) > 1 Then if right(Request.QueryString("dirpath"),1)="/" then strPath = Request.QueryString("dirpath") else strPath = Request.QueryString("dirpath") & "/" end if end If ' on submit - save files if Request.ServerVariables("REQUEST_METHOD") = "POST" then Dim uploadmessage uploadmessage = SaveFiles(Server.MapPath(strPath)) End If %> {#advimage_dlg.dialog_title}
<% If errorMessage <>"" Then%>
<%= errorMessage %>
<% End If %>
{#advimage_dlg.directory_browser}
<% Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Dim objFolder Set objFolder = objFSO.GetFolder(Server.MapPath(strPath)) Dim RowCount : RowCount = 0 Dim objItem For Each objItem In objFolder.SubFolders If InStr(1, objItem, "_vti", 1) = 0 Then%> class="darkRow"<% End If %>> <% RowCount = RowCount + 1 End If Next %> <% For Each objItem In objFolder.Files %> <% if right(objItem.Name,4)=".png" or right(objItem.Name,4)=".jpg" or right(objItem.Name,4)=".gif" or right(objItem.Name,4)=".bmp" then %> class="darkRow"<% End If %>> <% end if %> <% RowCount = RowCount + 1 Next Set objItem = Nothing Set objFolder = Nothing Set objFSO = Nothing %>
{#advimage_dlg.filename} {#advimage_dlg.filesize} (Kb) {#advimage_dlg.filemodified}
     
<%= ShowImageForType("dir") %> <%= objItem.Name %> <%'= objItem.Size %> <%= objItem.DateCreated %>
<%= ShowImageForType(objItem.Name) %> <%= objItem.Name %> <%= formatnumber(objItem.Size/1024,1) %> <%= objItem.DateCreated %>
{#advimage_dlg.preview}
{#advimage_dlg.tab_appearance}
{#advimage_dlg.example_img} Lorem ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
x px