---
title: "ASPsmartUpload"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/102384-aspsmartupload"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Silve"
published: "2004-04-26T18:50:52.000Z"
updated: "2004-04-27T06:05:38.000Z"
replies: 1
views: 284
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/102384-aspsmartupload"
---

# ASPsmartUpload

## #1 — Silve, 2004-04-26T18:50Z

Hej!

Har ett script i ASPsmartupload...
en bild laddas upp helt felfritt...
men nu vill jag ha med filnamnet på filen i en session som skall heta "filnamn"....har försökt på hur många sätt som helst men blir inte klokare av något...

kan det vara något med:
Session("namnet på sessionen") = file.FileName
men vart isf skall den ligga?
Object Required blir errormesset om jag lägger in den raden...

\<%
  On Error Resume Next

'  Variables
'  \*\*\*\*\*\*\*\*\*
  Dim mySmartUpload
  Dim intCount
  
'  Object creation
'  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

'  Only allow txt or htm files
'  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  mySmartUpload.AllowedFilesList = "gif,jpg,jpeg"

'  DeniedFilesList can also be used :
  ' Allow all files except exe, bat and asp
  ' \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  ' mySmartUpload.DeniedFilesList = "exe,bat,asp"

'  Deny physical path
'  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  mySmartUpload.DenyPhysicalPath = True

'  Only allow files smaller than 50000 bytes
'  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  mySmartUpload.MaxFileSize = 500000000

'  Deny upload if the total fila size is greater than 200000 bytes
'  \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
  mySmartUpload.TotalMaxFileSize = 200000

'  Upload
'  \*\*\*\*\*\*
  mySmartUpload.Upload

  intCount = mySmartUpload.Save("../images/rampljuset")
  ' sample with a physical path 
  ' intCount = mySmartUpload.Save("../images/rampljuset")

'  Trap errors
'  \*\*\*\*\*\*\*\*\*\*\*
  If Err Then
  Response.Write("Wrong selection : " & Err.description)
  Else

Response.Redirect "rampljuset.asp?section=upload2"

  
  End If

%\>

Permalänk: https://www.webforum.nu/p/102384

## #2 — Jesper T, 2004-04-27T06:05Z

Testa att lägga den här(fetmarkering).
Var vänlig och använd \[ kod\]-taggar. 

```
<%
On Error Resume Next

' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

' Only allow txt or htm files
' ***************************
mySmartUpload.AllowedFilesList = "gif,jpg,jpeg"

' DeniedFilesList can also be used :
' Allow all files except exe, bat and asp
' ***************************************
' mySmartUpload.DeniedFilesList = "exe,bat,asp"

' Deny physical path
' *******************
mySmartUpload.DenyPhysicalPath = True

' Only allow files smaller than 50000 bytes
' *****************************************
mySmartUpload.MaxFileSize = 500000000

' Deny upload if the total fila size is greater than 200000 bytes
' ************************************************************
***
mySmartUpload.TotalMaxFileSize = 200000

' Upload
' ******
mySmartUpload.Upload

intCount = mySmartUpload.Save("../images/rampljuset")
' sample with a physical path 
' intCount = mySmartUpload.Save("../images/rampljuset")

[b]Session("namnet på sessionen") = mySmartUpload.Files.Item(1).FileName[/b]

' Trap errors
' ***********
If Err Then
Response.Write("Wrong selection : " & Err.description)
Else

Response.Redirect "rampljuset.asp?section=upload2"

End If

%>
```

/red

Permalänk: https://www.webforum.nu/p/1334145

---

Tråden på webben: https://www.webforum.nu/amne/asp/102384-aspsmartupload
