Motivation
This is a small follow-up feature for the existing
SetFormFieldOnFileUpload. The existing feature is used by the
ChangeProfilePicture user interface to upload and set a profile picture in one step.
This new proposal allows TWiki app developers to define the format of the form field that contains the name of the uploaded file.
Description and Documentation
The existing
updatefield URL parameter supported in the upload script defines the TWiki form field name to update with the name of the uploaded file.
The new
updateformat URL parameter proposed for the upload script defines the format of the TWiki form field name to update with the name of the uploaded file. The default is
$file, e.g. the name of the uploaded file.
Use case: A TWiki app has dashboards that allows users to select a banner image from a library (such as
TWikiDashboardImages), or to upload a new banner image that is stored in the dashboard topic. In this case, the image can have two locations, e.g. web and topic name and the image name need to be recorded in a "Banner Image" form field so that the banner image can be shown in the dashboard. The
updateformat can be set to
Web/Topic/$file instead of just the file name. That way, the banner image URL can be constructed as
%PUBURL%/%FORMFIELD{ "Banner Image" topic="%BASETOPIC%" }%.
Examples
Impact
Implementation
--
Contributors:
Peter Thoeny - 2014-12-09
Discussion
This is now accepted by 7 days feedback period.
--
Peter Thoeny - 2014-12-15