Feature Proposal: Set form field on file upload (to select profile picture)
Motivation
For the
MoreVisualUserHomepages feature we need an easy way to update profile pictures. The profile picture name is recorded in a form field name called "Image". For ease of use, this form field should be automatically updated when attaching a profile picture.
Description and Documentation
This features supports a new
updatefield parameter to the
upload script. If set and if the value matches the name of a form field, it will update that form field with the name of the uploaded file.
Examples
<form name="main" enctype="multipart/form-data" action="%SCRIPTURL{upload}%/%WEB%/%TOPIC%" method="post" />
__Upload new picture:__ %BR%
<input type="file" name="filepath" value="" size="36" />
<input type="submit" class="twikiSubmit" value='Upload' />
<input type="hidden" name="filename" value="" />
<input type="hidden" name="filecomment" value="" />
<input type="hidden" name="createlink" value="" />
<input type="hidden" name="hidefile" value="on" />
<input type="hidden" name="updatefield" value="Image" />
</form>
Impact
Implementation
--
Contributors: PeterThoeny - 2011-06-08
Discussion
This is now accepted by 7 days feedback period. It is also implemented in
SVN trunk.
--
PeterThoeny - 2011-06-18
Followup feature proposed:
SetFormFieldFormatOnFileUpload.
--
Peter Thoeny - 2014-12-09