---
title: "Upload igen"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/13431-upload-igen"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "dahlgren"
published: "2001-12-30T12:54:00.000Z"
updated: "2001-12-30T16:16:00.000Z"
replies: 7
views: 202
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/13431-upload-igen"
---

# Upload igen

## #1 — dahlgren, 2001-12-30T12:54Z

Vet att jag tagit upp det här förut men har inte riktigt fått det att funka.

```
<%response.buffer=true

Set Upload = Server.CreateObject("Persits.Upload.1") 
Upload.Save "e:\dweb\docs\"
Namn = Upload.form("FILE2")
fil = Right(Namn,3) 
Filnamn = Namn 
Set File = Upload.Files(1) 
Set Connection = Server.CreateObject ("ADODB.Connection")	
Connection.Open "driver={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("/dweb/db/d768698.mdb")
SQLStmt = "Insert into docs " 
SQLStmt = SQLStmt & " (namn, beskrivning, kategori) " 
SQLStmt = SQLStmt & " Values('" & upload.Form("FILE2") & "', '" & upload.Form("DESCRIPTION") & "', '" & upload.Form("CATEGORY") & "')"
Connection.Execute(SQLStmt) 
SET SQLStmt = Nothing 
SQLStmt = "Select Max(Id) as senasteid from docs" 
SET RS = Connection.Execute(SQLStmt)
RS.Close
SQLStmt = "update docs SET namn = '" & Filnamn & "'" 
Connection.Execute(SQLStmt)
Connection.Close 
SET SQLStmt = Nothing 
response.write SQLStmt
response.end
Connection.Close 
Set Upload = Nothing
response.redirect "default.asp" %>
```

Koden ger detta felmedelande\*:
Response object error 'ASP 0185 : 80020003' 

Missing Default Property 

/dweb/intern/dokument/upload.asp, line 0 

A default property was not found for the object. 

Vad menas med det? Hur löser jag det?

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

## #2 — icaaq, 2001-12-30T15:12Z

<http://support.persits.com/show.asp?code=PS0103069> 

vassego :)

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

## #3 — icaaq, 2001-12-30T15:14Z

eller jag hade kanske lite bråttom....

kolla denna istället där finns det säkert
 <http://support.persits.com/Default.asp?Words=Any&query=Response+object+error+>

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

## #4 — icaaq, 2001-12-30T15:16Z

eller jag kanske hade för bråttom igen....

varför har du response.Buffer högst upp, är det inte den som spökar da?

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

## #5 — dahlgren, 2001-12-30T15:39Z

Hittade inget som handlade om default property.

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

## #6 — icaaq, 2001-12-30T15:44Z

hur ser formuläret som skickar datan ut?

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

## #7 — Pace, 2001-12-30T15:44Z

Förmodligen rör det sig om någon metod (property) som inte angets för objektet "Persits.Upload.1". Kontrollera med manualen i så fall.

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

## #8 — dahlgren, 2001-12-30T16:16Z

Formuläret

```
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.asp">
  <p>&nbsp;</p>
        <p>
          <INPUT TYPE=FILE NAME="FILE2" size="25">
          <BR>
          <BR>
          <INPUT TYPE=TEXT NAME="DESCRIPTION" value="Beskrivning av filen" size="25">
          <BR>
          <SELECT NAME="CATEGORY">
      <option value="inf">Information</option>
      <option value="sch">Schema</option>
      <option value="pic">Bilder</option>
      <option value="lek">Lekar</option>
      <option value="cer">Cermonier</option>
      <option value="spe">Spex</option>
      <option value="pdf">PDF-dokument</option>
      <option value="html">HTML-dokument</option>
      <option value="doc">&Ouml;vrigt</option>
    </SELECT>
          <BR>
          <INPUT TYPE=SUBMIT VALUE="Skicka">
        </p>
      </FORM>
```

Detta finner jag i manualen men kan inte förstå hur jag ska använda det.

> Notice that our HTML form now has two kinds of input boxes, TYPE=FILE and TYPE=TEXT. Because of the ENCTYPE attribute of out form, we can no longer access the form variables via the standard ASP Request.Form collection. That's where the Upload.Form collection comes to the rescue. This collection is almost identical to Request.Form, i.e. we can access its elements via integer or string indexes, for example: 
>
> Set Item1 = Upload.Form("DESCR1") 
>
> or 
>
> Set Item1 = Upload.Form(1). 
>
> We can also scroll through the items in the collection using the For-Each statement as shown in the code sample above. The Form collection contains objects of the type FormItem which only have two string properties, Name and Value (default property). 
>
> It's important to remember that the Upload.Form collection only includes non-file items, i.e. form items other than \<INPUT TYPE=FILE\>. We have chosen to have another collection, namely Files, to contain objects of the type UploadedFile which represent uploaded files that came from the \<INPUT TYPE=FILE\> items. Much like the Form collection, the Files collection items can be accessed using string or integer indexed, or via a For-Each statement, as shown in the example above.

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

---

Tråden på webben: https://www.webforum.nu/amne/asp/13431-upload-igen
