Kald denne fil for fx. upload.asp <!-- Begynd kode --> <HTML> <BODY BGCOLOR="white">
<H1>aspSmartUpload : Sample 3</H1> <HR>
<% On Error Resume Next
' Variables ' ********* Dim mySmartUpload Dim intCount Dim uploadDir uploadDir = "/billeder"
' Object creation ' *************** Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
' Only allow images (tilføj selv flere extensions) ' *************************** mySmartUpload.AllowedFilesList = "jpg,jpeg,gif"
' DeniedFilesList can also be used : ' Allow all files except exe, bat and asp ' *************************************** ' mySmartUpload.DeniedFilesList = "exe,bat,asp"
' Only allow files smaller than 50000 bytes ' ***************************************** mySmartUpload.MaxFileSize = 50000
' Deny upload if the total fila size is greater than 200000 bytes ' *************************************************************** mySmartUpload.TotalMaxFileSize = 200000
' Upload ' ****** mySmartUpload.Upload
for each file in mySmartUpload.Files
' Save the files with their original names in a virtual path of the web server ' Definer selv hvor filen skal placeres. ' **************************************************************************** mySmartUpload.Save(uploadDir & "/" & file.FileName) ' sample with a physical path ' intCount = mySmartUpload.Save("c:\temp\")
' Trap errors ' *********** If Err Then Response.Write("<b>Wrong selection : </b>" & Err.description) Else ' Display the number of files uploaded ' ************************************ Response.Write("<img src=""" & uploadDir & "/" & file.FileName) End If next %> </BODY> </HTML>
<!-- Slut kode -->
Kald dernæst denne fil for noget andet efter eget valg... <!-- Begynd kode --> <HTML> <BODY BGCOLOR="white">
Hvad så med hensyn til at den automatisk skal vise dem på en eller anden side? lad os sige jeg har en billedarkivs-side hvor jeg skal have vist de billeder jeg uploader.. ?
Hey daywalker, skal du have mere hjælp i forbindelse med det her spg ?
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.