![]() |
| Form with ENCTYPE="Multipart/form-data" not passin |
|
superjew1
|
I am trying to insert everything in to a database AND upload a file at the same time. When I add the ENCTYPE="Multipart/form-data" to the form and try to upload - it wont pass the other form variables (name, address) to the next page to upload them to the DB.
http://drube.com/EO/profileSubmission.asp?oID=1 is the page with the form and the upload The error i get is ---- Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. /EO/profileSubmission_confirm.asp, line 87 There is nothing wrong with the syntax becuase when i take all of that out - it works any advice - please help !!! If you have any other questions - email me at danny@drube.com - THANKS! |
||||||||||||
|
|
|||||||||||||
|
spoulson
|
You are right in using enctype="multipart/form-data" because you have a file upload field and that required that encoding type. However, I don't see anything wrong with the HTML of the page. I think you will need to have a test page ASP made that verifies the form data that was submitted and is usable by the ASP code. The INSERT error sounds like the form data is getting lost or garbled in one encoding and not the other, causing the SQL statement to not run properly.
|
||||||||||||
|
|
|||||||||||||
| Update - Fix and Need more help |
|
superjew1
|
I figured out how to get the form information to pass (incase any one needs it) you have to use Upload.Form instead of Request.form: oCompany = Upload.Form("oCompany")
My problem now is that it is giving me an error when i try to store the FileName in to a variable to insert it in to the DB. Heres the code: DIM oResume Set Upload = Server.CreateObject("Persits.Upload.1") <!-- set upload --> Upload.SaveVirtual("/EO/resumes") <!-- set directory--> Response.Write(oFile.FileName) <!-- write filename for test --> SET oFile = Upload.Files("oResume") <!-- set oFiles = FileName --> SET oResume = oFile.FileName <!-- set oResume = FileName --> Heres the Error: Microsoft VBScript runtime error '800a01a8' Object required: '[string: "DanielRubenstein_Res"]' /EO/profileSubmission_confirm.asp, line 74 Please help - Thanks!! |
||||||||||||
|
|
|||||||||||||
| Update - Fix and Need more help |
|
superjew1
|
I figured out how to get the form information to pass (incase any one needs it) you have to use Upload.Form instead of Request.form: oCompany = Upload.Form("oCompany")
My problem now is that it is giving me an error when i try to store the FileName in to a variable to insert it in to the DB. The page is: http://drube.com/EO/profileSubmission.asp?oID=1 Heres the code: DIM oResume Set Upload = Server.CreateObject("Persits.Upload.1") <!-- set upload --> Upload.SaveVirtual("/EO/resumes") <!-- set directory--> Response.Write(oFile.FileName) <!-- write filename for test --> SET oFile = Upload.Files("oResume") <!-- set oFiles = FileName --> SET oResume = oFile.FileName <!-- set oResume = FileName --> Heres the Error: Microsoft VBScript runtime error '800a01a8' Object required: '[string: "DanielRubenstein_Res"]' /EO/profileSubmission_confirm.asp, line 74 Please help - Thanks!! |
||||||||||||
|
|
|||||||||||||
|
spoulson
|
It looks like you're not making the calls in the rigtht order or with the right calls.
If you haven't already, check out the knowledge base article on the ASPUpload tool. Then, check out the object reference. From the looks of it, you'll want to use code similar to this:
Hope this helps. Note, don't use <!-- --> comments in ASP code, this may also cause errors. Use single quotes in VBScript for comments like I did above. |
||||||||||||||
|
|
|||||||||||||||
| GOT IT!! |
|
superjew1
|
AWESOME! Thanks so much. I finally got it working.
|
||||||||||||
|
|
|||||||||||||
| Form with ENCTYPE="Multipart/form-data" not passin |
|
||
|


