Problem with Text.XHtml.Strict.Formlets.file on Mac OSX

I'm writing a form that involves picking a file to upload, and so uses Text.XHtml.Strict.Formlets.file. The form displays OK, but when I click the Browse button, and select a file from the dialog (no matter what the file type), and then click on the Submit button, I get an error: "fval[2] is not a file" I haven't added any validation yet. The generated html looks ok to me: <input type="file" name="fval[2]" id="fval[2]"> This is on my laptop running Mac OSX. I can't test it on Linux until I get home at the weekend, so I don't know if I've made a silly error in my coding, but it is very simple: imageInputForm = F.plug (\xhtml -> X.p << (X.label << "Image file:") +++ xhtml) F.file Are there any known problems with the file formlet? Might it be OSX specific? -- Colin Adams Preston, Lancashire, ENGLAND

Hey Colin, The code looks OK to me. Are you sure you are setting the right method for your form? It's the third component of the tuple returned by the runFormState. Thanks, -chris On 22 sep 2009, at 08:56, Colin Adams wrote:
I'm writing a form that involves picking a file to upload, and so uses Text.XHtml.Strict.Formlets.file. The form displays OK, but when I click the Browse button, and select a file from the dialog (no matter what the file type), and then click on the Submit button, I get an error:
"fval[2] is not a file"
I haven't added any validation yet.
The generated html looks ok to me:
<input type="file" name="fval[2]" id="fval[2]">
This is on my laptop running Mac OSX. I can't test it on Linux until I get home at the weekend, so I don't know if I've made a silly error in my coding, but it is very simple:
imageInputForm = F.plug (\xhtml -> X.p << (X.label << "Image file:") +++ xhtml) F.file
Are there any known problems with the file formlet? Might it be OSX specific? -- Colin Adams Preston, Lancashire, ENGLAND _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Chris Eidhof
-
Colin Adams