944,044 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Marked Solved
  • Views: 1509
  • ASP RSS
Oct 2nd, 2009
0

Asp upload BinaryRead error

Expand Post »
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

Quote ...
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

ASP Syntax (Toggle Plain Text)
  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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LurkerPatrol is offline Offline
14 posts
since Sep 2006
Oct 6th, 2009
0
Re: Asp upload BinaryRead error
Nevermind guys, I figured out a workaround.
Last edited by LurkerPatrol; Oct 6th, 2009 at 3:26 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LurkerPatrol is offline Offline
14 posts
since Sep 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: ASP Cookie Detection Alert Code Issues
Next Thread in ASP Forum Timeline: Help (ASP)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC