Hi everyone,

So I have a form that I'm running which has an option to upload a resume.

The form itself is actually multi-page but it all sits inside 1 asp file. The way I manage that is to use a select function and case function and depending on the "page" it will display the appropriate form material.

I have loaded in some asp code that I found online for uploading, and it works when it's stand-alone.

However when I incorporate it into my form code, it gives me the error

Request object error 'ASP 0206 : 80004005'

Cannot call BinaryRead

/members/Loader.asp, line 36

Cannot call BinaryRead after using Request.Form collection.

My code is as such

<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>
<!--#include virtual="/Connections/CTRI_Web.asp" -->
<!--#include file="Loader.asp"-->
<%
	Const NUMBER_OF_PAGES = 4
	Const DBOR = true
	
	Dim intPreviousPage
	Dim intCurrentPage
	Dim strItem
	Dim AbortMessage
	Dim AlertMsg
	Dim email
	Dim pw
	Dim pwconfirm
	Dim gonext
	Dim results
	Dim fitem
	Dim eMailResults
	Dim UploadAbortMessage
	Session("fileName") = ""
	Session("filePath") = ""
	Session("extension") = ""
	Session("eemail") = ""
	Application("pathToFile") = ""
%>
<% Function uHaul()
	Response.Buffer = True

	' load object
	Dim load
		Set load = new Loader
		
		' calling initialize method
		load.initialize
		
	' File binary data
	Dim fileData
		fileData = load.getFileData("file")
	' File name
	Dim fileName
		fileName = LCase(load.getFileName("file"))
	Session("fileName") = fileName
	' File path
	Dim filePath
		filePath = load.getFilePath("file")
	' File path complete
	Dim filePathComplete
		filePathComplete = load.getFilePathComplete("file")
	' File size
	Dim fileSize
		fileSize = load.getFileSize("file")
	' File size translated
	Dim fileSizeTranslated
		fileSizeTranslated = load.getFileSizeTranslated("file")
	' Content Type
	Dim contentType
		contentType = load.getContentType("file")
	' No. of Form elements
	Dim countElements
		countElements = load.Count
	' Value of text input field "name"
	Dim nameInput
		nameInput = load.getValue("name")
	' Path where file will be uploaded
	Dim pathToFile
		pathToFile = Server.mapPath("/Uploader/uploaded/") & "\" & Session("eemail") & Session("fileName")
		Application("pathToFile") = pathToFile
	' Uploading file data
	Dim fileUploaded
		fileUploaded = load.saveToFile ("file", pathToFile)
		
	' destroying load object
	Set load = Nothing

End Function
%>

This bit of code sits right on top of everything else.

So what exactly have I done wrong and how can I go about fixing it?

Thanks for all of your advice and help.

-LP

PS. Ignore the session and application variables, it was part of a test that didn't go so well.

Nevermind guys, I figured out a workaround.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.