フォルダーにワードやパワポ、エクセルファイルを置くとホームページに表示されるようにしたい
2003年までの拡張子だと、フォルダーに置くとそのままホームページに表示されるのですが、それ以降のオフィスの拡張子、xlsx,docx,pptx,.accdbにするとおいてもホームページにファイルが表示されません。
下記のコードの拡張子を最新の拡張子に書き換えてみたのですが何も変化がありませんでした。
html
1 If ( ext = ".xls" ) or ( ext = ".doc" ) or ( ext = ".mdb" ) or ( ext = ".ppt" ) or ( ext = ".pdf" ) or ( ext = ".zip" ) or (ext = ".xlsx") Then
html
1<% 2 Dim FileSystem, objFolder, objFile, PropReader, DocProp 3 Dim ext, ico, nam1, nam2, upd, comm, siz, sizk 4 5 Set FileSystem = Server.CreateObject("Scripting.FileSystemObject") 6 Set objFolder = FileSystem.GetFolder(Server.MapPath("Files/")) 7 If objFolder.Files.Count = 0 Then 8 Response.Write("ファイルが存在しません。") 9 End If 10 11 Set PropReader = Server.CreateObject("DSOleFile.PropertyReader") 12 13%> 14<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 15"http://www.w3.org/TR/html4/loose.dtd"> 16<html> 17<head> 18<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS"> 19<meta name="GENERATOR" content="JustSystems Homepage Builder Version 16.0.10.0 for Windows"> 20<title>新商品関連</title> 21 22<link href="css_n/2014nn.css" rel="stylesheet" type="text/css"> 23<link href="../css/style_pick.css" rel="stylesheet" type="text/css"> 24</head> 25 26 27 28 29 30 31 32 33 34<body> 35<!--メインコンテンツエリアスタート --> 36<div class="container"> 37 <a name="top"></a> <img src="../../../images/2015_0811.jpg" alt="イメージ" width="700" height="150" class="asp_image" > 38 39 40 <div id="asp_ttl">案内情報 </div> 41<div class="asp_tiTitle">ファイル名を右クリック&「対象をファイルに保存」等を実施して御利用下さい。</div> 42 43 44 <TABLE width="700" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" class="collapse"> 45 <TBODY> 46 <TR> 47 <TD width="480" align="center" class="largcellblue">ファイル名</TD> 48 <TD width="105" align="center" nowrap class="largcellblue">更新日</TD> 49 <TD width="57" align="center" nowrap class="largcellblue">内容</TD> 50 <TD width="48" align="center" nowrap class="largcellblue">容量</TD> 51 </TR> 52 <% 53 For Each objFile In objFolder.Files 54 55 On Error Resume Next 56 57 ext = Right(objFile.Name, 4) 58 59 If ( ext = ".xls" ) or ( ext = ".doc" ) or ( ext = ".accdb" ) or ( ext = ".ppt" ) or ( ext = ".pdf" ) or ( ext = ".zip" ) or (ext = ".xlsx") Then 60 61 ico = Right(ext,3) 62 nam1 = objFile.Name 63 nam2 = Left(nam1,Len(nam1)-4) 64 upd = Int(objFile.DateLastModified) 65 siz = objFile.Size 66 sizk = Int( siz / 1024 ) 67 68 Set DocProp = PropReader.GetDocumentProperties(objFile.Path) 69 comm = DocProp.Comments 70 If Len(comm) < 1 Then 71 comm = "-" 72 End if 73 74%> 75 <TR> 76 <TD align="left" nowrap class="mOdd02"><IMG src="Icons/<%Response.Write(ico)%>.gif" border="0" align="absmiddle"><a href="Files/<%Response.Write(nam1)%>" target="_blank" > 77 <%Response.Write(nam2)%> 78 </a></TD> 79 <TD align="center" nowrap class="mOdd02"><%Response.Write(upd)%></TD> 80 <TD align="center" class="mOdd02"><%Response.Write(comm)%></TD> 81 <TD align="center" nowrap class="mOdd02"><%Response.Write(sizk)%> 82 KB</TD> 83 </TR> 84 <% 85 End If 86 87 Next 88 89%> 90 <tr> 91 <td height="35" colspan=4 ><!--yokowatari --></td> 92 </tr> 93 <tr> 94 <td height="35" colspan=4 ><!--<div class="rc03"><a href="../../index.html" target="_top">MENUページへ戻る</a></div>--> 95 <div class="rc03"><a href="../../../index.html" target="_top">トップページへ戻る</a></div></td> 96 </tr> 97 98 </TBODY> 99 </TABLE> 100 101 102<table width="700" border="0" cellspacing="0" cellpadding="0"> 103 <tr> 104 <td><div id="disclaimer"><a href="#top"><img src="../../../image/arr_discl_top_n.gif" alt="トップへ" width="8" height="9" hspace="1" vspace="2" border="0"></a> 105 <div class="footerProvidedby"> 106 <div class="footerLink">提供 </div> 107 </div> 108 <div class="footerDate">最終更新日 00/00/2014</div> 109 </div></td> 110 </tr> 111</table> 112</div> 113</body> 114</html>
回答1件
あなたの回答
tips
プレビュー