Hi
Im a soccer coach, and have alot of drills that i need to show on a page, i got that but when i click a file, the browser is trying to open it.
SEE ADDED FILE, i will pref. 1-1 and a half Work day.
So i need someone to fix this script, so i can:
- Show the files like now.
- When clicking a file, the "Save As" dialog is showed.
- Showing the Filename without .xxx (right now its showed with .xxx).
- Showing the filesize in kb if under a mb and then else in mb.
- 2 links that showed if "[login to view URL] = "Admin"".
one rename file link, so the file can be renamed.
one delete link, so the file can be deleted.
the two link need to work.
Thats it, if u changes the code, then i only have 2 things thats need to work as now.
- The layout for the UL/LI need to work as now.
- If the file ia an image then show the image as now, if pdf, doc.... then use the [login to view URL] as now.
my code thats show the files..
main_code
<div class="data-container">
<header>
<h2>Filer tilgængelige for holdet</h2>
</header>
<section>
<ul class="thumbnails">
<asp:DataList ID="showfiles" runat="server" RepeatColumns="6" CellPadding="10" RepeatLayout="flow">
<ItemTemplate>
<li class="span2"><a class="thumbnail" href='<%# [login to view URL]([login to view URL],"FullName") %>'><span style="text-align:center"><asp:Image ID="folderfiles" runat="server" ImageUrl='<%# getImageUrl([login to view URL]([login to view URL],"Name")) %>' ToolTip='<%# [login to view URL]([login to view URL],"Name") %>' height="82" width="119" /><b><%# [login to view URL]([login to view URL],"Name") %></b></span></a></li>
</ItemTemplate>
</asp:DataList>
</ul>
</section>
</div>
Code_Behind
'Show files on page
Sub fileinfo()
Dim objDI As New [login to view URL]([login to view URL]("upload/files/"))
Dim allFile As New ArrayList()
[login to view URL]([login to view URL]("*.png"))
[login to view URL]([login to view URL]("*.jpg"))
[login to view URL]([login to view URL]("*.bmp"))
[login to view URL]([login to view URL]("*.gif"))
[login to view URL]([login to view URL]("*.pdf"))
[login to view URL]([login to view URL]("*.doc"))
[login to view URL]([login to view URL]("*.docx"))
[login to view URL] = allFile
[login to view URL]()
End Sub
'If file other then image then use diffrent icon image
Protected Function getImageUrl(filename As String) As String
Select Case [login to view URL](filename)
Case ".pdf"
Return "upload/[login to view URL]"
Case ".doc"
Return "upload/[login to view URL]"
Case ".docx"
Return "upload/[login to view URL]"
Case ".txt"
Return "upload/[login to view URL]"
Case ".xls"
Return "upload/[login to view URL]"
Case ".xlsx"
Return "upload/[login to view URL]"
Case ".rar"
Return "upload/[login to view URL]"
Case ".zip"
Return "upload/[login to view URL]"
End Select
Return [login to view URL]("upload/files/{0}", filename)
End Function