Working Code Sample for field -type='file'?

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Working Code Sample for field -type='file'?

stevepiercy
Does anyone have a working Knop code sample for uploading files
with a field of type file that they would be willing to share?

I have a form that works fine if I comment out this field:

$f -> addfield(
     -type='file',
     -name='fu');

It also works if I do not select a file to upload, leaving the
field value blank.

But whenever I select a file to upload and submit the form, the
web browser perpetually attempts to load something but never
completes, and after about 10 minutes (which is my thread
execution time limit for the site) I get an Apache 500 ISE.

My file upload code sample without Knop works fine.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

jasonhuck
By chance, do you separately need to do something to make sure the  
parent form element contains the enctype="multipart..." attribute?

- Jason



On Jun 7, 2010, at 6:59 AM, Steve Piercy - Web Site Builder <[hidden email]
 > wrote:

> Does anyone have a working Knop code sample for uploading files with  
> a field of type file that they would be willing to share?
>
> I have a form that works fine if I comment out this field:
>
> $f -> addfield(
>    -type='file',
>    -name='fu');
>
> It also works if I do not select a file to upload, leaving the field  
> value blank.
>
> But whenever I select a file to upload and submit the form, the web  
> browser perpetually attempts to load something but never completes,  
> and after about 10 minutes (which is my thread execution time limit  
> for the site) I get an Apache 500 ISE.
>
> My file upload code sample without Knop works fine.
>
> --steve
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy               Web Site Builder               Soquel, CA
> <[hidden email]>                  <http://www.StevePiercy.com/>
>
>
> --
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
> Project homepage http://montania.se/projects/knop/
> Google Code has the latest downloads at http://code.google.com/p/knop/

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
Knop should set the enctype automatically when a file field is present in the form.

Steve, does the generated html look good?

Does it make any difference if you slkip ->loadfields in the action file?


At 07.59 -0400 2010-06-07, Jason Huck wrote:

>By chance, do you separately need to do something to make sure the parent form element contains the enctype="multipart..." attribute?
>
>- Jason
>
>
>
>On Jun 7, 2010, at 6:59 AM, Steve Piercy - Web Site Builder <[hidden email]> wrote:
>
>>Does anyone have a working Knop code sample for uploading files with a field of type file that they would be willing to share?
>>
>>I have a form that works fine if I comment out this field:
>>
>>$f -> addfield(
>>   -type='file',
>>   -name='fu');
>>
>>It also works if I do not select a file to upload, leaving the field value blank.
>>
>>But whenever I select a file to upload and submit the form, the web browser perpetually attempts to load something but never completes, and after about 10 minutes (which is my thread execution time limit for the site) I get an Apache 500 ISE.
>>
>>My file upload code sample without Knop works fine.
>>
>>--steve
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy               Web Site Builder               Soquel, CA
>><[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>>--
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list <[hidden email]>.
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>Project homepage http://montania.se/projects/knop/
>>Google Code has the latest downloads at http://code.google.com/p/knop/
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>Project homepage http://montania.se/projects/knop/
>Google Code has the latest downloads at http://code.google.com/p/knop/


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
Ya, it's there and all relevant HTML looks good:

<form action="/admin/bids/" method="post" id="form1" enctype="multipart/form-data">
<input type="file" name="fu" id="form9_fu8">

When I comment out ->loadfields, every field is marked as
invalid even though the values are valid, but at least I don't
get the ISE after 10 minutes.  Incidentally throughout all my
testing, I had commented out any file_uploads related code
because I originally thought that was causing a problem.  So my
guess here is that the file field type is not getting processed
by Knop correctly?  Not sure what to do next.

--steve


On 6/7/10 at 4:03 PM, [hidden email] (Johan Solve) pronounced:

>Knop should set the enctype automatically when a file field is present in the form.
>
>Steve, does the generated html look good?
>
>Does it make any difference if you slkip ->loadfields in the action file?
>
>
>At 07.59 -0400 2010-06-07, Jason Huck wrote:
>>By chance, do you separately need to do something to make sure the parent form
>element contains the enctype="multipart..." attribute?
>>
>>- Jason
>>
>>
>>
>>On Jun 7, 2010, at 6:59 AM, Steve Piercy - Web Site Builder <[hidden email]>
>wrote:
>>
>>>Does anyone have a working Knop code sample for uploading files with a field of
>type file that they would be willing to share?
>>>
>>>I have a form that works fine if I comment out this field:
>>>
>>>$f -> addfield(
>>>   -type='file',
>>>   -name='fu');
>>>
>>>It also works if I do not select a file to upload, leaving the field value blank.
>>>
>>>But whenever I select a file to upload and submit the form, the web browser
>perpetually attempts to load something but never completes, and
>after about 10 minutes (which is my thread execution time limit
>for the site) I get an Apache 500 ISE.
>>>
>>>My file upload code sample without Knop works fine.
>>>
>>>--steve
>>>
>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>Steve Piercy               Web Site Builder               Soquel, CA
>>><[hidden email]>                  <http://www.StevePiercy.com/>
>>>
>>>
>>>--
>>>#############################################################
>>>This message is sent to you because you are subscribed to
>>>the mailing list <[hidden email]>.
>>>To unsubscribe, E-mail to: <[hidden email]>
>>>Send administrative queries to  <[hidden email]>
>>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>>Project homepage http://montania.se/projects/knop/
>>>Google Code has the latest downloads at http://code.google.com/p/knop/
>>
>>--
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list <[hidden email]>.
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>Project homepage http://montania.se/projects/knop/
>>Google Code has the latest downloads at http://code.google.com/p/knop/
>
>
>--
>Johan Sölve    [FSA Member, Lasso Partner]
>Web Application/Lasso/FileMaker Developer
>MONTANIA SOFTWARE & SOLUTIONS
>http://www.montania.se   mailto:[hidden email]
>(spam-safe email address, replace '-' with 'a')
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
At 11.30 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:
>Ya, it's there and all relevant HTML looks good:
>
><form action="/admin/bids/" method="post" id="form1" enctype="multipart/form-data">
><input type="file" name="fu" id="form9_fu8">
>
>When I comment out ->loadfields, every field is marked as invalid even though the values are valid, but at least I don't get the ISE after 10 minutes.  Incidentally throughout all my testing, I had commented out any file_uploads related code because I originally thought that was causing a problem.  So my guess here is that the file field type is not getting processed by Knop correctly?  Not sure what to do next.


Rather, the file field type is not being ignored by Knop properly.

You get validation errors because the form don't see any values since you disabled ->loadfields. Totally expected.

Knop doesn't do anything at all with the upload, you have to handle that yourself. But it does ignore it.

I checked the code for loadfields and it does indeed ignore file inputs

if: (self -> 'exceptionfieldtypes') !>> #fieldpair -> value -> (find: 'type') // do not load data for excluded form fields (maybe it should do that in some cases???)

Earlier:
local: ... 'exceptionfieldtypes' = (map: 'file', 'submit', 'reset', 'image', 'addbutton', 'savebutton', 'deletebutton', 'cancelbutton',
                                'fieldset', 'legend', 'html')


I use file inputs with Knop without problems. The only thing that comes to mind right now is if there is a naming conflict between the file input and some other field.



>--steve
>
>
>On 6/7/10 at 4:03 PM, [hidden email] (Johan Solve) pronounced:
>
>>Knop should set the enctype automatically when a file field is present in the form.
>>
>>Steve, does the generated html look good?
>>
>>Does it make any difference if you slkip ->loadfields in the action file?
>>
>>
>>At 07.59 -0400 2010-06-07, Jason Huck wrote:
>>>By chance, do you separately need to do something to make sure the parent form
>>element contains the enctype="multipart..." attribute?
>>>
>>>- Jason
>>>
>>>
>>>
>>>On Jun 7, 2010, at 6:59 AM, Steve Piercy - Web Site Builder <[hidden email]>
>>wrote:
>>>
>>>>Does anyone have a working Knop code sample for uploading files with a field of
>>type file that they would be willing to share?
>>>>
>>>>I have a form that works fine if I comment out this field:
>>>>
>>>>$f -> addfield(
>>>>  -type='file',
>>>>  -name='fu');
>>>>
>>>>It also works if I do not select a file to upload, leaving the field value blank.
>>>>
>>>>But whenever I select a file to upload and submit the form, the web browser
>>perpetually attempts to load something but never completes, and after about 10 minutes (which is my thread execution time limit for the site) I get an Apache 500 ISE.
>>>>
>>>>My file upload code sample without Knop works fine.
>>>>
>>>>--steve
>>>>
>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>Steve Piercy               Web Site Builder               Soquel, CA
>>>><[hidden email]>                  <http://www.StevePiercy.com/>
>>>>
>>>>
>>>>--
>>>>#############################################################
>>>>This message is sent to you because you are subscribed to
>>>>the mailing list <[hidden email]>.
>>>>To unsubscribe, E-mail to: <[hidden email]>
>>>>Send administrative queries to  <[hidden email]>
>>>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>>>Project homepage http://montania.se/projects/knop/
>>>>Google Code has the latest downloads at http://code.google.com/p/knop/
>>>
>>>--
>>>#############################################################
>>>This message is sent to you because you are subscribed to
>>>the mailing list <[hidden email]>.
>>>To unsubscribe, E-mail to: <[hidden email]>
>>>Send administrative queries to  <[hidden email]>
>>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>>Project homepage http://montania.se/projects/knop/
>>>Google Code has the latest downloads at http://code.google.com/p/knop/
>>
>>
>>--
>>Johan Sölve    [FSA Member, Lasso Partner]
>>Web Application/Lasso/FileMaker Developer
>>MONTANIA SOFTWARE & SOLUTIONS
>>http://www.montania.se   mailto:[hidden email]
>>(spam-safe email address, replace '-' with 'a')
>>
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>Steve Piercy               Web Site Builder
>Soquel, CA
><[hidden email]>                  <http://www.StevePiercy.com/>
>
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>Project homepage http://montania.se/projects/knop/
>Google Code has the latest downloads at http://code.google.com/p/knop/


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
On 6/7/10 at 8:58 PM, [hidden email] (Johan Solve) pronounced:

>At 11.30 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:
>>Ya, it's there and all relevant HTML looks good:
>>
>><form action="/admin/bids/" method="post" id="form1" enctype="multipart/form-data">
>><input type="file" name="fu" id="form9_fu8">
>>
>>When I comment out ->loadfields, every field is marked as invalid even though the
>values are valid, but at least I don't get the ISE after 10
>minutes.  Incidentally throughout all my testing, I had
>commented out any file_uploads related code because I
>originally thought that was causing a problem.  So my guess
>here is that the file field type is not getting processed by
>Knop correctly?  Not sure what to do next.
>
>
>Rather, the file field type is not being ignored by Knop properly.
>
>You get validation errors because the form don't see any values
>since you disabled ->loadfields. Totally expected.

Yup, I expected that, too, but mentioned it for completeness.

>Knop doesn't do anything at all with the upload, you have to
>handle that yourself. But it does ignore it.

Ya, I expected that, too.

In fact when I comment out loadfields, the file upload works great.

>I checked the code for loadfields and it does indeed ignore file inputs
>
>if: (self -> 'exceptionfieldtypes') !>> #fieldpair -> value ->
>(find: 'type') // do not load data for excluded form fields
>(maybe it should do that in some cases???)

Yup, got that:
knop.lasso:2637:
if: (self -> 'exceptionfieldtypes') !>> #fieldpair -> value ->
(find: 'type') // do not load data for excluded form fields
(maybe it should do that in some cases???)

>Earlier:
>local: ... 'exceptionfieldtypes' = (map: 'file', 'submit',
>'reset', 'image', 'addbutton', 'savebutton', 'deletebutton', 'cancelbutton',
>'fieldset', 'legend', 'html')

Yup, got that, too:
         'exceptionfieldtypes' = (map: 'file', 'submit',
'reset', 'image', 'addbutton', 'savebutton', 'deletebutton', 'cancelbutton',
                 'fieldset', 'legend', 'html'); // special types

>I use file inputs with Knop without problems. The only thing
>that comes to mind right now is if there is a naming conflict
>between the file input and some other field.

Nope, all fields have unique names.  Nonetheless, I took your
idea of a bad field name in the config file, so I commented out
all fields except the file field and a submit button with
loadfields in there.  No ISE!  AHA!

I isolated it to this field:

$f -> addfield(
     -type='text',
     -label='Bid Date',
     -dbfield='bid_date',
     -class='dpDate datepick',
     -name='bdate',
     -id='bid_date',
//  -size=10,   // when commented, it works!  when uncommented I
get the ISE
     -validate=$v_bid_date,
     -required

How weird is that?!

--steve



>>--steve
>>
>>
>>On 6/7/10 at 4:03 PM, [hidden email] (Johan Solve) pronounced:
>>
>>>Knop should set the enctype automatically when a file field is present in the
>form.
>>>
>>>Steve, does the generated html look good?
>>>
>>>Does it make any difference if you slkip ->loadfields in the action file?
>>>
>>>
>>>At 07.59 -0400 2010-06-07, Jason Huck wrote:
>>>>By chance, do you separately need to do something to make sure the parent form
>>>element contains the enctype="multipart..." attribute?
>>>>
>>>>- Jason
>>>>
>>>>
>>>>
>>>>On Jun 7, 2010, at 6:59 AM, Steve Piercy - Web Site Builder <[hidden email]>
>>>wrote:
>>>>
>>>>>Does anyone have a working Knop code sample for uploading files with a field of
>>>type file that they would be willing to share?
>>>>>
>>>>>I have a form that works fine if I comment out this field:
>>>>>
>>>>>$f -> addfield(
>>>>>  -type='file',
>>>>>  -name='fu');
>>>>>
>>>>>It also works if I do not select a file to upload, leaving the field value
>blank.
>>>>>
>>>>>But whenever I select a file to upload and submit the form, the web browser
>>>perpetually attempts to load something but never completes, and after about 10
>minutes (which is my thread execution time limit for the site)
>I get an Apache 500 ISE.
>>>>>
>>>>>My file upload code sample without Knop works fine.
>>>>>
>>>>>--steve
>>>>>
>>>>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>Steve Piercy               Web Site Builder               Soquel, CA
>>>>><[hidden email]>                  <http://www.StevePiercy.com/>
>>>>>
>>>>>
>>>>>--
>>>>>#############################################################
>>>>>This message is sent to you because you are subscribed to
>>>>>the mailing list <[hidden email]>.
>>>>>To unsubscribe, E-mail to: <[hidden email]>
>>>>>Send administrative queries to  <[hidden email]>
>>>>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>>>>Project homepage http://montania.se/projects/knop/
>>>>>Google Code has the latest downloads at http://code.google.com/p/knop/
>>>>
>>>>--
>>>>#############################################################
>>>>This message is sent to you because you are subscribed to
>>>>the mailing list <[hidden email]>.
>>>>To unsubscribe, E-mail to: <[hidden email]>
>>>>Send administrative queries to  <[hidden email]>
>>>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>>>Project homepage http://montania.se/projects/knop/
>>>>Google Code has the latest downloads at http://code.google.com/p/knop/
>>>
>>>
>>>--
>>>Johan Sölve    [FSA Member, Lasso Partner]
>>>Web Application/Lasso/FileMaker Developer
>>>MONTANIA SOFTWARE & SOLUTIONS
>>>http://www.montania.se   mailto:[hidden email]
>>>(spam-safe email address, replace '-' with 'a')
>>>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy               Web Site Builder
>>Soquel, CA
>><[hidden email]>                  <http://www.StevePiercy.com/>
>>
>>
>>--
>>#############################################################
>>This message is sent to you because you are subscribed to
>>the mailing list <[hidden email]>.
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>>Project homepage http://montania.se/projects/knop/
>>Google Code has the latest downloads at http://code.google.com/p/knop/
>
>
>--
>Johan Sölve    [FSA Member, Lasso Partner]
>Web Application/Lasso/FileMaker Developer
>MONTANIA SOFTWARE & SOLUTIONS
>http://www.montania.se   mailto:[hidden email]
>(spam-safe email address, replace '-' with 'a')
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
At 13.05 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:

>I isolated it to this field:
>
>$f -> addfield(
>    -type='text',
>    -label='Bid Date',
>    -dbfield='bid_date',
>    -class='dpDate datepick',
>    -name='bdate',
>    -id='bid_date',
>//  -size=10,   // when commented, it works!  when uncommented I get the ISE
>    -validate=$v_bid_date,
>    -required
>
>How weird is that?!

11.

At least.

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
On 6/7/10 at 10:26 PM, [hidden email] (Johan Solve) pronounced:

>At 13.05 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:
>>I isolated it to this field:
>>
>>$f -> addfield(
>>-type='text',
>>-label='Bid Date',
>>-dbfield='bid_date',
>>-class='dpDate datepick',
>>-name='bdate',
>>-id='bid_date',
>>//  -size=10,   // when commented, it works!  when uncommented I get the ISE
>>-validate=$v_bid_date,
>>-required
>>
>>How weird is that?!
>
>11.
>
>At least.

At first I thought that was a reference to This Is Spinal Tap.
http://www.youtube.com/watch?v=UeOXsA8sp_E

But I changed it to 11, and it worked.  Is there a reason for a
minimum value for the size attribute for inputs of type text?  
W3 says inputs of type text can have size equal to any positive integer.
http://www.w3.org/TR/html401/interact/forms.html#adef-size-INPUT

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
At 14.42 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:
>On 6/7/10 at 10:26 PM, [hidden email] (Johan Solve) pronounced:
>>>How weird is that?!
>>
>>11.
>>
>>At least.
>
>At first I thought that was a reference to This Is Spinal Tap.
>http://www.youtube.com/watch?v=UeOXsA8sp_E

It was...


>But I changed it to 11, and it worked.  Is there a reason for a minimum value for the size attribute for inputs of type text?  W3 says inputs of type text can have size equal to any positive integer.
>http://www.w3.org/TR/html401/interact/forms.html#adef-size-INPUT

How weird is THAT?

Knop does nothing with the -size parameter besides using it in the html form. -size is used as size attribute only.


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Conny Larsson

Ha ha, so fun to see how confusing it can be.
This one "begins" at 11 ;-)

/C

8 jun 2010 kl. 00.04 skrev Johan Solve:

> At 14.42 -0700 2010-06-07, Steve Piercy - Web Site Builder wrote:
>> On 6/7/10 at 10:26 PM, [hidden email] (Johan Solve) pronounced:
>>>> How weird is that?!
>>>
>>> 11.
>>>
>>> At least.
>>
>> At first I thought that was a reference to This Is Spinal Tap.
>> http://www.youtube.com/watch?v=UeOXsA8sp_E
>
> It was...
>
>
>> But I changed it to 11, and it worked.  Is there a reason for a minimum value for the size attribute for inputs of type text?  W3 says inputs of type text can have size equal to any positive integer.
>> http://www.w3.org/TR/html401/interact/forms.html#adef-size-INPUT
>
> How weird is THAT?
>
> Knop does nothing with the -size parameter besides using it in the html form. -size is used as size attribute only.
>
>
> --
>     Johan Sölve    [FSA Member, Lasso Partner]
>     Web Application/Lasso/FileMaker Developer
>     MONTANIA SOFTWARE & SOLUTIONS
> http://www.montania.se   mailto:[hidden email]
> (spam-safe email address, replace '-' with 'a')
>
> --
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list <[hidden email]>.
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
> List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
> Project homepage http://montania.se/projects/knop/
> Google Code has the latest downloads at http://code.google.com/p/knop/

____________________________________
Montania System AB
http://www.montania.se

Conny Larsson




--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
In reply to this post by Johan Solve-2
On 6/8/10 at 12:04 AM, [hidden email] (Johan Solve) pronounced:

>>But I changed it to 11, and it worked.  Is there a reason for a minimum value for
>the size attribute for inputs of type text?  W3 says inputs of
>type text can have size equal to any positive integer.
>>http://www.w3.org/TR/html401/interact/forms.html#adef-size-INPUT
>
>How weird is THAT?
>
>Knop does nothing with the -size parameter besides using it in
>the html form. -size is used as size attribute only.

ARGH!  I was wrong.  The ISE always comes exactly 5 minutes and
0 seconds after the first click to submit a form.  Apparently
the first click initiates the 5:00 time bomb.  Then any changes
made to any files up until that 5:00 mark will work just fine,
until at 5:00 KA-BOOM!  So I made some changes to shorten that
5:00 delay.

I shortened the thread execution time limit from 600 to 60
seconds for the site, and that had no effect.

I found that the 300 seconds timeout is a default value for
Apache 2.2.  I shortened it for the virtual host to 30 seconds
so I don't have to keep waiting an extra 4:30 for the ISE.
http://httpd.apache.org/docs/2.2/mod/core.html#timeout

I inserted log_critical at the start and end of each file,
including global configs, to isolate where this thing barfs.

I've got Lasso in console mode to see if there is something I
can uncover.  There is no difference in Lasso Console for
requests that result in an ISE and those that do not.

I cannot consistently reproduce the ISE.  Currently I have the
following, and I change nothing at all in the files.

* All fields configured as normally I would, including -size
parameters and file fields.
* loadfields in the action file.

I follow the same steps every time:

* Start from grid.
* Click first record.
* Select the same file for upload.
* Click Save.

I was able to capture HTML immediately prior to both a good and
bad submission, and compare them, but they were virtually
identical with only times changed.

Any other ideas?

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
On 6/7/10 at 5:38 PM, [hidden email] (Steve Piercy - Web
Site Builder) pronounced:

>Any other ideas?

I found that if I walk away from the computer for at least 10
minutes, then sneak up on it and go through the usual process
(grid > edit record > select file upload > submit), I can cause
the ISE.  But when I repeat the exact same steps again in under
10 minutes after the ISE, I cannot get another ISE.

What takes 10 minutes to time out?

I wonder if there is some kind of MySQL or SQLite related issue?

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
On 6/7/10 at 6:59 PM, [hidden email] (Steve Piercy - Web
Site Builder) pronounced:

>On 6/7/10 at 5:38 PM, [hidden email] (Steve Piercy - Web
>Site Builder) pronounced:
>
>>Any other ideas?
>
>I found that if I walk away from the computer for at least 10
>minutes, then sneak up on it and go through the usual process
>(grid > edit record > select file upload > submit), I can cause
>the ISE.  But when I repeat the exact same steps again in under
>10 minutes after the ISE, I cannot get another ISE.
>
>What takes 10 minutes to time out?
>
>I wonder if there is some kind of MySQL or SQLite related issue?

Can someone add this field to their Knop demo in:

/_config/cfg_advanced_edit.inc
---------------------------------
     $f -> (addfield:
             -type='file',
             -name='file');

...then select a file to upload, then click submit?  I can
generate an ISE on the first try, but again not on subsequent
tries for the next 10 minutes.

Back to my files, any time I submit the form with no file
selected for upload, regardless of how long I wait, there is no problem.

I can successfully repeat the ISE by waiting 10 minutes, going
to grid > select record > select file for upload > save record.  
Then when I get the ISE, if I reload the ISE error page,
everything processes normally!

Mac OS X 10.5.8, Apache 2.2.14, LP 8.5.6.

I've deployed this on CentOS 5.4, Apache 2.2.8 to see if I can
replicate it using the exact same steps.  So far it hasn't.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
In reply to this post by stevepiercy
On 6/7/10 at 5:38 PM, [hidden email] (Steve Piercy - Web
Site Builder) pronounced:

>Any other ideas?

Another clue.  There is an interesting effect I kept noticing
when I would submit a file for upload.  <form action="foo">
would append all the standard -upload parameters to the action.  
So I modified my local version of Knop to exclude them.  I don't
know whether that should be incorporated with the rest of Knop.

So in form.inc, look for this:
     #output +='<form';

And a little further down, you'll see this twice:
     if: #clientparam -> name -> (beginswith: '-')

Change to:
     if: #clientparam -> name -> (beginswith: '-')
     && !(#clientparam -> name -> (beginswith: '-upload'))

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
Steve, I think you nailed it! I had no idea the -upload parameters were added to client_postparams.

So when uploading a file and then return to the same form, Knop probably adds a bunch of hidden inputs with the -upload parameters from the previous upload (is that right?). In other words, the first upload works but not the subsequent ones. If you checked the html on the second upload form, you should see these hidden inputs. I can see how Lasso can get confused by this, although I think it should guard itself against it.

Here's a simple test to see the -upload parameters appear after submitting.
<form method="post" action="[response_filepath]" enctype="multipart/form-data">
<input type="file" name="myfile">
<input type="submit">
</form>
[client_postparams -> join('<br>')]


Result:
pair: (-upload.realname)=(imagefile.png)
pair: (-upload.name)=(/var/tmp/lasso-tmpvnDBXq10726455.uld)
pair: (-upload.type)=(image/png)
pair: (-upload.size)=(39311)
pair: (-upload.fieldname)=(myfile)
pair: (-upload2.fieldname)=(myfile)


At 01.28 -0700 2010-06-10, Steve Piercy - Web Site Builder wrote:

>On 6/7/10 at 5:38 PM, [hidden email] (Steve Piercy - Web Site Builder) pronounced:
>
>>Any other ideas?
>
>Another clue.  There is an interesting effect I kept noticing when I would submit a file for upload.  <form action="foo"> would append all the standard -upload parameters to the action.  So I modified my local version of Knop to exclude them.  I don't know whether that should be incorporated with the rest of Knop.
>
>So in form.inc, look for this:
>    #output +='<form';
>
>And a little further down, you'll see this twice:
>    if: #clientparam -> name -> (beginswith: '-')
>
>Change to:
>    if: #clientparam -> name -> (beginswith: '-')
>    && !(#clientparam -> name -> (beginswith: '-upload'))
>
>--steve
>
>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>Steve Piercy               Web Site Builder
>Soquel, CA
><[hidden email]>                  <http://www.StevePiercy.com/>
>
>
>--
>#############################################################
>This message is sent to you because you are subscribed to
>the mailing list <[hidden email]>.
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>
>List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
>Project homepage http://montania.se/projects/knop/
>Google Code has the latest downloads at http://code.google.com/p/knop/


--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
At 11.06 +0200 2010-06-10, Johan Solve wrote:
>So when uploading a file and then return to the same form, Knop probably adds a bunch of hidden inputs with the -upload parameters from the previous upload (is that right?).

Actually, the -upload params are probably tacked to the form action.

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

Johan Solve-2
In reply to this post by stevepiercy
At 01.28 -0700 2010-06-10, Steve Piercy - Web Site Builder wrote:

>On 6/7/10 at 5:38 PM, [hidden email] (Steve Piercy - Web Site Builder) pronounced:
>
>>Any other ideas?
>
>Another clue.  There is an interesting effect I kept noticing when I would submit a file for upload.  <form action="foo"> would append all the standard -upload parameters to the action.  So I modified my local version of Knop to exclude them.  I don't know whether that should be incorporated with the rest of Knop.
>
>So in form.inc, look for this:
>    #output +='<form';
>
>And a little further down, you'll see this twice:
>    if: #clientparam -> name -> (beginswith: '-')
>
>Change to:
>    if: #clientparam -> name -> (beginswith: '-')
>    && !(#clientparam -> name -> (beginswith: '-upload'))
>
>

I've added this fix, but changed it slightly to be more explicit

if: #clientparam -> name -> (beginswith: '-')
    && !(#clientparam -> name -> (beginswith: '-upload.'))
    && !(#clientparam -> name -> (beginswith: '-upload2.'))
...

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:[hidden email]
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
In reply to this post by Johan Solve-2
On 6/10/10 at 1:15 PM, [hidden email] (Johan Solve) pronounced:

>At 11.06 +0200 2010-06-10, Johan Solve wrote:
>>So when uploading a file and then return to the same form, Knop probably adds a
>bunch of hidden inputs with the -upload parameters from the
>previous upload (is that right?).
>
>Actually, the -upload params are probably tacked to the form action.

Yes, that is exactly what was happening.

<form
action="/admin/bids/?-upload.realname=chuckie.jpg&-upload.name=/var/tmp/lasso-tmpGN9p1H2083870.uld&-upload.type=image/jpeg&-upload.size=11377&-upload.fieldname=fu&-upload2.fieldname=fu"
... >

I hope this is it.  I have not seen any ISEs for a while, so
I'll keep my fingers crossed.

Incidentally I have had no problem on the CentOS production
server yet.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
In reply to this post by stevepiercy
On 6/10/10 at 3:39 PM, [hidden email] (Steve Piercy - Web
Site Builder) pronounced:

>I hope this is it.  I have not seen any ISEs for a while, so I'll keep my fingers crossed.

Spoke too soon.  Just got another ISE.  At least the form action
does not have a bunch of -upload parameters appended to it.

I tried a new test.  I used my file upload script outside of
Knop, but added a text input.  The first time I tried it, I got
an ISE.  Previously my test script did not have a text field.

I repeated this test on both another Knop site and a non-Knop
site, and both worked immediately.

To make sure that Knop was not the cause, I went back to the
problem site and I pulled out the Knop library, restarted the
site, and tried again.  ISE right away.  That left just one
thing, Apache config.  I stripped it down to the bare minimum,
and now it works of course.  *sigh*  Sorry for the red herring.  
I will see which combination of directives cause it to break.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
Reply | Threaded
Open this post in threaded view
|

Re: Working Code Sample for field -type='file'?

stevepiercy
On 6/10/10 at 4:16 PM, [hidden email] (Steve Piercy - Web
Site Builder) pronounced:

>To make sure that Knop was not the cause, I went back to the
>problem site and I pulled out the Knop library, restarted the
>site, and tried again.  ISE right away.  That left just one
>thing, Apache config.  I stripped it down to the bare minimum,
>and now it works of course.  *sigh*  Sorry for the red
>herring.  I will see which combination of directives cause it
>to break.

Well, I worked through each directive.  For two of them, I got
an ISE after uploading a file, but reloading the Apache ISE page
resulted in a successfully uploaded the file, and subsequent
tests worked.  I could not repeat the ISE reliably.

Whenever I commented out the offending directives, I usually got
no ISE, but randomly I would get one.

It's weird inconsistent voodoo.

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/
12