Mailing List Archive

Using uploadhelper widget in the Admin (table editor)
I'm trying to add a file upload widget (uploadhelper.widget) to an
existing table. I added a new column to represent the field, adjusted
the column to use "uploadhelper" as its widget, and started tinkering
with the widget configuration.

It appeared to me that you could control what options get passed into
the widget by adding "name=value" pairs to the widget in the "Typical"
tab:

Options | path=pdf |
| umask=022 |
| value=_UI_VALUE |

"umask" and "value" seem to work, as the resulting HTML looks like this:

<input type="file" name="document_file" value="blahblahblah">
<input type="hidden" name="ui_upload_file_path:document_file" value="">
<input type="hidden" name="document_file" value="blahblahblah">
<input type="hidden" name="ui_upload_umask:document_file" value="022">

but as you can see, "path" is not set. I've tracked this into the
widget's code, and it appears "path" isn't passed in as an option.

Does anyone have advice here, or a successful use of the widget in the
admin?

--
Jeff Boes <><
jeff@endpoint.com
(269) 408-0811

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Using uploadhelper widget in the Admin (table editor) [ In reply to ]
Quoting Jeff Boes (jeff@endpoint.com):
> I'm trying to add a file upload widget (uploadhelper.widget) to an
> existing table. I added a new column to represent the field,
> adjusted the column to use "uploadhelper" as its widget, and started
> tinkering with the widget configuration.
>
> It appeared to me that you could control what options get passed
> into the widget by adding "name=value" pairs to the widget in the
> "Typical" tab:
>
> Options | path=pdf |
> | umask=022 |
> | value=_UI_VALUE |
>
> "umask" and "value" seem to work, as the resulting HTML looks like this:
>
> <input type="file" name="document_file" value="blahblahblah">
> <input type="hidden" name="ui_upload_file_path:document_file" value="">
> <input type="hidden" name="document_file" value="blahblahblah">
> <input type="hidden" name="ui_upload_umask:document_file" value="022">
>
> but as you can see, "path" is not set. I've tracked this into the
> widget's code, and it appears "path" isn't passed in as an option.
>
> Does anyone have advice here, or a successful use of the widget in
> the admin?

It is normally done with the "outboard" parameter in the metadata.
That gets automatically passed in Vend::Table::Editor, I beleive.

--
Mike Heins
End Point -- Expert Internet Consulting http://www.endpoint.com/
phone +1.765.253.4194 <mikeh@endpoint.com>

An empty head is not really empty; it is stuffed with rubbish. Hence
the difficulty of forcing anything into an empty head. -- Eric Hoffer

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Using uploadhelper widget in the Admin (table editor) [ In reply to ]
On 2015-09-10 21:35, Mike Heins wrote:
>
> It is normally done with the "outboard" parameter in the metadata.
> That gets automatically passed in Vend::Table::Editor, I beleive.

Hmm. I tried "outboard" but it didn't seem to work. My current solution
was to hack the uploadhelper widgets to parse the "options" parameter to
tease out the "path=.*" part and use that.

If you have a working example I'd be very grateful for a chance to look
it over.

--
Jeff Boes <><
jeff@endpoint.com
(269) 408-0811

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Using uploadhelper widget in the Admin (table editor) [ In reply to ]
Quoting Jeff Boes (jeff@endpoint.com):
> On 2015-09-10 21:35, Mike Heins wrote:
> >
> >It is normally done with the "outboard" parameter in the metadata.
> >That gets automatically passed in Vend::Table::Editor, I beleive.
>
> Hmm. I tried "outboard" but it didn't seem to work. My current
> solution was to hack the uploadhelper widgets to parse the "options"
> parameter to tease out the "path=.*" part and use that.
>
> If you have a working example I'd be very grateful for a chance to
> look it over.
>

Just tested it. Any IC demo will work.

1. Create a directory in your catalog directory, "foo". Make sure it
is writable by the IC daemon.

2. Go to the Items tab in the admin, and pick any old field. Edit the
metadata to set widget to uploadhelper, and go to the "Advanced"
tab and set Directory to "foo".

3. Save the widget, then go to that field in the admin. You should see
an upload widget.

Now use the widget to upload a file, and you will see that it goes
to the "foo" directory.

--
Mike Heins
End Point -- Expert Internet Consulting http://www.endpoint.com/
phone +1.765.253.4194 <mikeh@endpoint.com>

{((>:o}~ <<<<Oh look!!! An idolatrous image of the prophet!!! Surely
we must now avenge this blasphemy by burning down the world!!!

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users
Re: Using uploadhelper widget in the Admin (table editor) [ In reply to ]
On 2015-09-14 09:01, Mike Heins wrote:
> Quoting Jeff Boes (jeff@endpoint.com):
>> Hmm. I tried "outboard" but it didn't seem to work.
>
> 2. Go to the Items tab in the admin, and pick any old field. Edit the
> metadata to set widget to uploadhelper, and go to the "Advanced"
> tab and set Directory to "foo".
>

Ah, thanks -- I see where I went wrong. I tried setting up "outboard"
(and "path", too), in the "options" field of the "Typical" tab. What
threw me is that some options you set here will work, but "outboard" and
"path" are not among them -- they are silently ignored.

--
Jeff Boes <><
jeff@endpoint.com
(269) 408-0811

_______________________________________________
interchange-users mailing list
interchange-users@icdevgroup.org
http://www.icdevgroup.org/mailman/listinfo/interchange-users