enctype="multipart/form-data" and request.form

Results 1 to 3 of 3

Thread: enctype="multipart/form-data" and request.form

  1. #1
    Join Date
    Dec 1969

    Default enctype="multipart/form-data" and request.form

    I have a script with a form that needs to be enctype="multipart/form-data" and request.form will not work on the asp page if this is the case. The reserch I have done so far tells me that the encription will not allow request form to read it. Is there any way (script) without having to install a component, to make this work. The script(Pure ASP Upload) I am trying to modify is designed to upload files to the server. I want to use a select box from the form to specify the destination. I have included the script below. I did not post the includes but can if they will help. Any help with this would be appreciated. <BR><BR><BR>&#060;%<BR>Option Explicit<BR>Dim ResultHTML<BR><BR>Server.ScriptTimeout = 200<BR><BR>Dim DestinationPath<BR>DestinationPath = Server.MapPath("ASPictureAlbums\" & Request.Form("DCText") & "Images")<BR><BR>Response.Write "DEBUG: DestinationPath is " & DestinationPath & "&#060;P&#062;"<BR>LogFolder = Server.MapPath(".")<BR>&#039;For Pure-ASP upload<BR> UploadSizeLimit = 10000000<BR><BR><BR>If Request.ServerVariables("REQUEST_METHOD") = "POST" Then <BR>&#039; BeginTimer &#039;Starts timer.<BR> &#039;******************************************** ***** Main Upload - start<BR> Dim Upload<BR>&#039; on error resume next<BR><BR><BR> Set Upload = GetUpload()<BR><BR> ResultHTML = ""<BR> If Err = 0 Then &#039;Upload was OK<BR> &#039;Write statistics about upload. Optional.<BR><BR> Dim Field<BR> For Each Field In Upload.Items<BR> ResultHTML = ""<BR> Next<BR><BR> ResultHTML = ResultHTML & SaveUpload(Upload, DestinationPath, LogFolder)<BR> Else <BR> ResultHTML = ResultHTML & "Error : " & Err.Description<BR> End If<BR> On Error GoTo 0<BR> Upload = Empty &#039;Clear the variable<BR> &#039;******************************************** ***** Main Upload - end<BR>&#039; EndTimer &#039;Writes info about consumed time.<BR>End If &#039;Request method must be "POST"<BR><BR>%&#062;<BR>&#060;%&#039;upload.i nc, contains GetUpload function, Required for upload - only the one file%&#062;<BR>&#060;!--#INCLUDE FILE="upload.inc"--&#062;<BR>&#060;%&#039;utils.inc, contains SaveUpload function%&#062;<BR>&#060;!--#INCLUDE FILE="utils.inc"--&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: enctype=

    Hi,<BR><BR>I ran into this problem but it was with ASPUpload. I had to replace "Request.Form" with "Upload.Form" this was specific to ASPUpload,so it may not work, but you could try it.

  3. #3
    Join Date
    Dec 1969

    Default You can NOT mix...

    ...file uploading with Request.Form! Period.<BR><BR>You have to rely upon the file-upload component to get the form contents for you.<BR><BR>As the other responder said, he replaced Request.Form with uploadObject.Form, but exactly what you need to do will depend on what upload component you use.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts