A department on campus once wanted to use the Dropbox for poster submissions for an upcoming conference. Ideally, they wanted to augment the usual dropoff web form seen on the Dropbox site with additional fields: presenter name and affiliation, account billing code for printing fees, etc. This could easily have been accomplished by their creating their own Dropbox server with UD's Dropbox software dedicated solely to this single purpose. The amount of effort required to provision necessary hardware and install and manage the software made that prospect less than palatable.
Since the Dropobox is, by design, open to the world for file dropoffs, no concerns were obvious in allowing other units on campus to create HTML forms on any other web server that use the Dropbox server as their form-processing target. This form referral service would collect additional form fields and add them to the dropoff as a single file (in addition to whatever files were uploaded from the form).
Any HTML form wishing to use the referral service should use an action
attribute of https://pandora.nss.udel.edu/referral.php
. The form should also possess a hidden field named Action
with the value dropoff
:
<form method="post" action="https://pandora.nss.udel.edu/referral.php" enctype="multipart/form-data"> <input type="hidden" name="Action" value="dropoff"/> </form>
The same fields that are present on the standard dropoff page should be used for the sender identity, recipient(s), and file(s):
recipient_csv
field)Returning to the impetus for this service, the basic form might look like this:
<form method="post" action="https://pandora.nss.udel.edu/referral.php" enctype="multipart/form-data"> <input type="hidden" name="Action" value="dropoff"/> <input type="hidden" name="recipEmail_1" value="poster-help@dept.udel.edu"/> <input type="hidden" name="recipient_1" value="1"/> <label for="senderName">Sender name:</label><input type="text" name="senderName" id="senderName"/> <label for="senderOrg">Sender organization:</label><input type="text" name="senderOrganization" id="senderOrg"/> <label for="senderEmail">Sender email:</label><input type="text" name="senderEmail" id="senderEmail"/> <input type="checkbox" name="confirmDelivery" id="confirmDelivery" checked="yes"/><label for="confirmDelivery">Deliver confirmation email?</label> <hr/> <label for="file_1">Poster (as a .zip file, please):</label><input type="file" name="file_1" id="file_1"/> <label for="desc_1">Brief description of poster:</label><input type="text" name="desc_1" id="desc_1"/> </form>
In order for the referral service to find and package any additional fields, a few additional fields must be present on an HTML form that uses the service (the name of the file will be AdditionalFormData.[extension]
where extension is dictated by the chosen format).
xml
, html
, or text
requiredNote that the affFailureURL
will have a CGI query parameter (message
) attached to it containing the nature of the error when the redirect is effected. The example form now might look like this:
<form method="post" action="https://pandora.nss.udel.edu/referral.php" enctype="multipart/form-data"> <input type="hidden" name="Action" value="dropoff"/> <input type="hidden" name="recipEmail_1" value="poster-help@dept.udel.edu"/> <input type="hidden" name="recipient_1" value="1"/> <input type="hidden" name="affPrefix" value="poster_"/> <input type="hidden" name="affFormat" value="xml"/> <input type="hidden" name="affSuccessURL" value="https://dept.udel.edu/posters/dropoff_okay.php"/> <input type="hidden" name="affFailureURL" value="https://dept.udel.edu/posters/dropoff_error.php"/> <label for="senderName">Sender name:</label><input type="text" name="senderName" id="senderName"/> <label for="senderOrg">Sender organization:</label><input type="text" name="senderOrganization" id="senderOrg"/> <label for="senderEmail">Sender email:</label><input type="text" name="senderEmail" id="senderEmail"/> <input type="checkbox" name="confirmDelivery" id="confirmDelivery" checked="yes"/><label for="confirmDelivery">Deliver confirmation email?</label> <hr/> <label for="sponsor">Sponsor/principal researcher:</label><input type="text" name="poster_sponsor" id="sponsor"/> <label for="acct_code">Account code for prints:</label><input type="text" name="poster_acct_code" id="acct_code"/> <label for="file_1">Poster (as a .zip file, please):</label><input type="file" name="file_1" id="file_1"/> <label for="desc_1">Brief description of poster:</label><input type="text" name="desc_1" id="desc_1"/> </form>
For this form, the AdditionalFormData.xml
file might look like this:
<?xml version="1.0" ?> <form-data> <sponsor>Big-Name Researcher Guy</sponsor> <acct_code>ACCT-CODE-001-00</acct_code> </form-data>
The text
format uses key=value pairs, one per line, while the html
format summarizes the key-value pairs in an HTML table.