PDA

View Full Version : validation on multipart form not working


aaron5263
03-31-2009, 10:03 AM
Im trying to apply the server validation behavior to a form that has an image upload field in it. Form is a multipart/form-data.

it does not work. i get an object not found when doing the validation.
does this server behavior work with multipart forms?

Thanks!
Aaron

Ray Borduin
03-31-2009, 10:10 AM
Are you using ASP? The problem is probably the way you are referring to form elements. You need to refer to them differently with asp multipart forms. What are you using for your upload? It will include a solution for how to refer to form elements.

aaron5263
03-31-2009, 10:57 AM
using dmx asp pureupload 3.0. yes using asp.
I applied aspupload to the page first. then applied the server validations behavior.
I can see the upload form elements within the webassist server interface. but it always now submits the form without throwing errors.

I have also mail uploaded files dmx extension applied on the page.

Ray Borduin
03-31-2009, 11:10 AM
You would have to check the pureuplaod documentation for what to replace Request.Form with... most likely it is something like UploadObj.Form. Once you figure out the right syntax, you can probably just do a find and replace.

aaron5263
04-02-2009, 10:01 AM
it still doesnt work. It does not throw an error but just lets the form submit without all fields validated. There are no request.form elements anywhere in the page.

Are you able to get server validations to work with multipart forms?

Thanks

Ray Borduin
04-02-2009, 11:54 AM
Yes. We do this in our Powerstore sample but that is php. The only thing that changes when you go to multipart forms is the way you refer to their values.

Is using our Digital File Pro an option for you? That would make me more familiar with your upload code and make it easier to find the solution. It is definitely possible, but like I said you may have to update a few lines of code where Request.Form is used.

eric341232
04-18-2009, 06:07 AM
I am also experiencing this difficulty with php and multipart forms. Can you tell me where I can find this Powerstore sample or, here, can you jot down how I need to refer to form values to get validation in the context of a multipart enctype form to work? That would be great.

Ray Borduin
04-20-2009, 08:02 AM
php doesn't have this difficulty with multipart forms. Please start a new thread describing your exact problem and we can try to help you through it.

info368164
08-25-2010, 01:14 AM
I have same identical problem with the same extension (PAU)
My solution (ASP Classic and VBScript):

Validation toolkit:
.........................
if (cStr(UploadFormRequest("Submit")) <> "") then
WAFV_Redirect = "mypage.asp"
Session("WAVT_COOPcompleta_Errors") = ""
if (WAFV_Redirect = "") then
WAFV_Redirect = cStr(Request.ServerVariables("SCRIPT_NAME"))
end if
WAFV_Errors = ""
WAFV_Errors = WAFV_Errors & WAValidateRQ(cStr(UploadFormRequest("textfield1")) & "",false,1)
WAFV_Errors = WAFV_Errors & WAValidateRQ(cStr(UploadFormRequest("textfield2")) & "",true,2)

if (WAFV_Errors<> "") then
PostResult WAFV_Redirect,WAFV_Errors,"mypage"
end if
end if
...............

for to fill the form with imputed data i use the sessions:
..........
if (cStr(UploadFormRequest("Submit")) <> "") then
Session("text1")=UploadFormRequest("textfield1")
Session("text2")=UploadFormRequest("textfield2")
end if
...........

Regards
Luca