%Option Explicit%> <% If isEmpty(Session("UserID")) Then Response.Redirect("index.asp") End If %>
|
Upload et nyt medie
<% On Error Resume Next ' Variables ' ********* Dim mySmartUpload Dim intCount dim file ' Object creation ' *************** Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload") mySmartUpload.AllowedFilesList = "gif,jpg,jpeg" mySmartUpload.DeniedFilesList = "exe,bat,asp" mySmartUpload.DenyPhysicalPath = True mySmartUpload.MaxFileSize = 50000 ' Upload ' ****** mySmartUpload.Upload ' Save the files with their original names in a virtual path of the web server ' **************************************************************************** intCount = mySmartUpload.Save("../pics") ' sample with a physical path ' intCount = mySmartUpload.Save("c:\temp\") ' Display the number of files uploaded ' ************************************ ' Select each file ' **************** For each file In mySmartUpload.Files ' Only if the file exist ' ********************** If not file.IsMissing Then If Err Then Response.Write(" Wrong selection : " & Err.description) & "" Else ' Display the number of files uploaded ' ************************************ response.write saveFileInMediaDB(file.FileName) Response.Write(file.FileName & " kan nu vælges fra listen. ") Response.Write(intCount & " fil(er) er uploaded.") End If End If Next %> |
|||
Vælg et medie:
|