Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
File upload into database doesn't work
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="dodger741, post: 11609353"] I am a new user of FP 2003 and am trying to host my web pages on GoDaddy.com I have been trying to create a web page using the database wizard to create a form to enter user information and ultimately to allow the user to upload a file (picture) to the database. I was successful in creating a simple form to enter name and address and got this to work after many trial and error exercises. The last one that made it work is to use the directory created by GoDaddy to store my database in. When I added an upload box/button to my form everything died. After entering data and submitting, the form just clears, doesn't even go the the confirmation page. I created a directory on the server to substitute for the "picupload" directory created by Frontpage and tried all the combinations of privileges allowed with no effect. When I enter data manually into the upload database I do see it in the results page which I think indicates the database connection is ok?? I have been playing with this for days with no closure. Any suggestions would be greatly appreciated. Is there a way to get error messages from the hosting site when are encountered?? I do not see any kind of error messages for the page that doesn't work. ************************************CODE WITH NO UPLOAD BUTTON - works******************** <% ' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit. On Error Resume Next Session("FP_OldCodePage") = Session.CodePage Session("FP_OldLCID") = Session.LCID Session.CodePage = 1252 Err.Clear strErrorUrl = "" If Request.ServerVariables("REQUEST_METHOD") = "POST" Then If Request.Form("VTI-GROUP") = "0" Then Err.Clear Set fp_conn = Server.CreateObject("ADODB.Connection") FP_DumpError strErrorUrl, "Cannot create connection" Set fp_rs = Server.CreateObject("ADODB.Recordset") FP_DumpError strErrorUrl, "Cannot create record set" fp_conn.Open Application("database1_ConnectionString") FP_DumpError strErrorUrl, "Cannot open database" fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable FP_DumpError strErrorUrl, "Cannot open record set" fp_rs.AddNew FP_DumpError strErrorUrl, "Cannot add new record set to the database" Dim arFormFields0(2) Dim arFormDBFields0(2) Dim arFormValues0(2) arFormFields0(0) = "Name" arFormDBFields0(0) = "Name" arFormValues0(0) = Request("Name") arFormFields0(1) = "Address" arFormDBFields0(1) = "Address" arFormValues0(1) = Request("Address") FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0 If Request.ServerVariables("REMOTE_HOST") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name" End If If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type" End If FP_SaveFieldToDB fp_rs, Now, "Timestamp" If Request.ServerVariables("REMOTE_USER") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name" End If fp_rs.Update FP_DumpError strErrorUrl, "Cannot update the database" fp_rs.Close fp_conn.Close FP_FormConfirmation "text/html; charset=windows-1252",_ "Form Confirmation",_ "Thank you for submitting the following information:",_ "submission_form.asp",_ "Return to the form." End If End If Session.CodePage = Session("FP_OldCodePage") Session.LCID = Session("FP_OldLCID") %> <% Response.Buffer = True %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Results -- New</title> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> </head> <body bgcolor="#FFFFFF"> <table width="100%" align=left> <tr> <td width="50%"> <b><font size=+3 color="#000080"> Submission Form </font></b> </td> <td width="50%" align=right> <table> <tr> <td> <a href="../results_page.asp" target="_top">Results Page</a> | Submission Form </td> </tr> </table> </td> </tr> </table> <p> <br clear="all"> <hr> <p> <form METHOD="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1"> <!--webbot bot="SaveDatabase" SuggestedExt="asp" S- DataConnection="database1" S-RecordSource="Results" S-Form- Fields="Name Address" S-Form-DBFields="Name Address" U-ASP-Include- Url="../../../_fpclass/fpdbform.inc" startspan U-Database- URL="../../../fpdb/database1.mdb" S-Builtin-Fields="REMOTE_HOST HTTP_USER_AGENT Timestamp REMOTE_USER" S-Builtin- DBFields="Remote_computer_name Browser_type Timestamp User_name" -- file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="52631" --> <p><b>Name</b><br> <!--webbot bot="Validation" s-display-name="Name" s-data- type="String" b-value-required="False" i-maximum-length="255" -- maxlength="255"><br> </p> <p><b>Address</b><br> <!--webbot bot="Validation" s-display-name="Address" s-data- type="Integer" s-number-separators="," i-maximum-length="5" -- </p> <p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p> </form> </body> </html> *****************************CODE WITH UPLOAD BUTTON ADDED doesn't work <% ' FP_ASP ASP Automatically generated by a FrontPage Component. Do not Edit. On Error Resume Next Session("FP_OldCodePage") = Session.CodePage Session("FP_OldLCID") = Session.LCID Session.CodePage = 1252 Err.Clear strErrorUrl = "" If Request.ServerVariables("REQUEST_METHOD") = "POST" Then If Request.Form("VTI-GROUP") = "0" Then Err.Clear Set fp_conn = Server.CreateObject("ADODB.Connection") FP_DumpError strErrorUrl, "Cannot create connection" Set fp_rs = Server.CreateObject("ADODB.Recordset") FP_DumpError strErrorUrl, "Cannot create record set" fp_conn.Open Application("database1_ConnectionString") FP_DumpError strErrorUrl, "Cannot open database" fp_rs.Open "Results", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable FP_DumpError strErrorUrl, "Cannot open record set" fp_rs.AddNew FP_DumpError strErrorUrl, "Cannot add new record set to the database" Dim arFormFields0(3) Dim arFormDBFields0(3) Dim arFormValues0(3) arFormFields0(0) = "Name" arFormDBFields0(0) = "Name" arFormValues0(0) = Request("Name") arFormFields0(1) = "F1" arFormDBFields0(1) = "F1" arFormValues0(1) = Request("F1") arFormFields0(2) = "Address" arFormDBFields0(2) = "Address" arFormValues0(2) = Request("Address") FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0 If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type" End If If Request.ServerVariables("REMOTE_HOST") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name" End If FP_SaveFieldToDB fp_rs, Now, "Timestamp" If Request.ServerVariables("REMOTE_USER") <> "" Then FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name" End If fp_rs.Update FP_DumpError strErrorUrl, "Cannot update the database" fp_rs.Close fp_conn.Close FP_FormConfirmation "text/html; charset=windows-1252",_ "Form Confirmation",_ "Thank you for submitting the following information:",_ "submission_form.asp",_ "Return to the form." End If End If Session.CodePage = Session("FP_OldCodePage") Session.LCID = Session("FP_OldLCID") %> <% Response.Buffer = True %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Results -- New</title> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> </head> <body bgcolor="#FFFFFF"> <table width="100%" align=left> <tr> <td width="50%"> <b><font size=+3 color="#000080"> Submission Form </font></b> </td> <td width="50%" align=right> <table> <tr> <td> <a href="../results_page.asp" target="_top">Results Page</a> | Submission Form </td> </tr> </table> </td> </tr> </table> <p> <br clear="all"> <hr> <p> <form METHOD="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1" enctype="multipart/form-data"> <!--webbot bot="SaveDatabase" SuggestedExt="asp" S- DataConnection="database1" S-RecordSource="Results" S-Form- Fields="Name F1 Address" S-Form-DBFields="Name F1 Address" U-ASP- Include-Url="../../../_fpclass/fpdbform.inc" startspan S- Destination="Picupload/" S-Category S-Assignedto S-ReviewStatus B- Process-MetaInfo="FALSE" U-Database-URL="../../../fpdb/database1.mdb" S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER" S- Builtin-DBFields="Browser_type Remote_computer_name Timestamp User_name" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!-- #include file="../../../_fpclass/fpdbform.inc"--><!--webbot bot="SaveDatabase" endspan i-checksum="52631" --> <p><b>Name</b><br> <!--webbot bot="Validation" s-display-name="Name" s-data- type="String" b-value-required="False" i-maximum-length="255" -- maxlength="255"><br> </p> <p><b>Address</b><br> <!--webbot bot="Validation" s-display-name="Address" s-data- type="Integer" s-number-separators="," i-maximum-length="5" -- <p><input type="file" name="F1" size="20"><br> </p> <p><input type="submit" value=" OK "><input type="reset" value=" Reset "></p> </form> </body> </html> [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Word
Microsoft Frontpage
File upload into database doesn't work
Top