Asp upload BinaryRead error

Thread Solved

Join Date: Sep 2006
Posts: 14
Reputation: LurkerPatrol is an unknown quantity at this point 
Solved Threads: 0
LurkerPatrol LurkerPatrol is offline Offline
Newbie Poster

Asp upload BinaryRead error

 
0
  #1
Oct 2nd, 2009
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

  1. <%@LANGUAGE="VBSCRIPT"%>
  2. <% Option Explicit %>
  3. <!--#include virtual="/Connections/CTRI_Web.asp" -->
  4. <!--#include file="Loader.asp"-->
  5. <%
  6. Const NUMBER_OF_PAGES = 4
  7. Const DBOR = true
  8.  
  9. Dim intPreviousPage
  10. Dim intCurrentPage
  11. Dim strItem
  12. Dim AbortMessage
  13. Dim AlertMsg
  14. Dim email
  15. Dim pw
  16. Dim pwconfirm
  17. Dim gonext
  18. Dim results
  19. Dim fitem
  20. Dim eMailResults
  21. Dim UploadAbortMessage
  22. Session("fileName") = ""
  23. Session("filePath") = ""
  24. Session("extension") = ""
  25. Session("eemail") = ""
  26. Application("pathToFile") = ""
  27. %>
  28. <% Function uHaul()
  29. Response.Buffer = True
  30.  
  31. ' load object
  32. Dim load
  33. Set load = new Loader
  34.  
  35. ' calling initialize method
  36. load.initialize
  37.  
  38. ' File binary data
  39. Dim fileData
  40. fileData = load.getFileData("file")
  41. ' File name
  42. Dim fileName
  43. fileName = LCase(load.getFileName("file"))
  44. Session("fileName") = fileName
  45. ' File path
  46. Dim filePath
  47. filePath = load.getFilePath("file")
  48. ' File path complete
  49. Dim filePathComplete
  50. filePathComplete = load.getFilePathComplete("file")
  51. ' File size
  52. Dim fileSize
  53. fileSize = load.getFileSize("file")
  54. ' File size translated
  55. Dim fileSizeTranslated
  56. fileSizeTranslated = load.getFileSizeTranslated("file")
  57. ' Content Type
  58. Dim contentType
  59. contentType = load.getContentType("file")
  60. ' No. of Form elements
  61. Dim countElements
  62. countElements = load.Count
  63. ' Value of text input field "name"
  64. Dim nameInput
  65. nameInput = load.getValue("name")
  66. ' Path where file will be uploaded
  67. Dim pathToFile
  68. pathToFile = Server.mapPath("/Uploader/uploaded/") & "\" & Session("eemail") & Session("fileName")
  69. Application("pathToFile") = pathToFile
  70. ' Uploading file data
  71. Dim fileUploaded
  72. fileUploaded = load.saveToFile ("file", pathToFile)
  73.  
  74. ' destroying load object
  75. Set load = Nothing
  76.  
  77. End Function
  78. %>
  79.  

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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 14
Reputation: LurkerPatrol is an unknown quantity at this point 
Solved Threads: 0
LurkerPatrol LurkerPatrol is offline Offline
Newbie Poster
 
0
  #2
Oct 6th, 2009
Nevermind guys, I figured out a workaround.
Last edited by LurkerPatrol; Oct 6th, 2009 at 3:26 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC