Toon posts:

[ASP] aspupload: textveld direct benaderen

Pagina: 1
Acties:
  • 24 views sinds 30-01-2008

Verwijderd

Topicstarter
ik moet, om aspupload te kunnen gebruiken, het form posten met enctype: multipart/form-data.

Nu zitten hier behalve bestandsvelden ook gewone textvelden. Maar ik weet niet hoe ik deze kan benaderen. ik heb wel een methode op hun website gezien om via een for each - lus te loopen in die andere velden:

For Each Item in Upload.Form
Response.Write Item.Name & "= " & Item.Value & "<BR>"
Next

maar dat wil ik niet, ik wil ze direct met hun veldnaam kunnen aanspreken. Hoe kan ik dit? thx ;)

  • gorgi_19
  • Registratie: Mei 2002
  • Laatst online: 19:24

gorgi_19

Kruimeltjes zijn weer op :9

The previous code sample uses the For-Each loop to iterate through the Files and Form collection. It is also possible to reference individual file and form items via integer or string indices, for example:
ASP:
1
Descr1 = Upload.Form("DESCR1") 

or
ASP:
1
Descr1 = Upload.Form(1) 

When referencing an individual item from the Files collection, it is a good idea to check whether a file was actually selected via the referenced input type=file box, as follows:
ASP:
1
2
3
4
Set File = Upload.Files("FILE1")
If Not File Is Nothing Then
   Response.Write File.Path
End If 

The Upload.Form collection is not entirely identical to Request.Form as it handles multi-select form items such as <SELECT MULTIPLE> differently.

The sample files Form3.asp and UploadScript3.asp (not shown here) demonstrate how to handle all basic input form items with the Upload.Form collection. Click the link below to run this code sample:

http://localhost/aspupload/02_simple/Form3.asp
http://localhost/aspupload/02_simple/Form3.aspx
Iets verder naar beneden scrollen dus in de documentatie :)

[ Voor 100% gewijzigd door gorgi_19 op 09-09-2004 19:59 ]

Digitaal onderwijsmateriaal, leermateriaal voor hbo


Dit topic is gesloten.