diff --git a/omeroweb/webclient/templates/webclient/scripts/include_param.html b/omeroweb/webclient/templates/webclient/scripts/include_param.html
index 9a2a0789e1..5ded2ce82f 100644
--- a/omeroweb/webclient/templates/webclient/scripts/include_param.html
+++ b/omeroweb/webclient/templates/webclient/scripts/include_param.html
@@ -90,6 +90,12 @@
{% if i.min %} Min: {{ i.min }} {% endif %}
{% if i.max %} Max: {{ i.max }} {% endif %}
+
+
+{% ifequal i.name 'File Annotation' %}
+ OR
+{% endifequal %}
+
diff --git a/omeroweb/webclient/views.py b/omeroweb/webclient/views.py
index 294cbb41cb..1ff11115f4 100755
--- a/omeroweb/webclient/views.py
+++ b/omeroweb/webclient/views.py
@@ -4337,10 +4337,22 @@ def script_run(request, scriptId, conn=None, **kwargs):
logger.debug("Script: run with request.POST: %s" % request.POST)
+ # upload new file
+ fileupload = ('file_annotation' in request.FILES and
+ request.FILES['file_annotation'] or None)
+ fileAnnId = None
+ if fileupload is not None and fileupload != "":
+ manager = BaseContainer(conn)
+ fileAnnId = manager.createFileAnnotations(fileupload, [])
+
for key, param in params.inputs.items():
prototype = param.prototype
pclass = prototype.__class__
+ if key == "File_Annotation" and fileAnnId is not None:
+ inputMap[key] = pclass(str(fileAnnId))
+ continue
+
# handle bool separately, since unchecked checkbox will not be in
# request.POST
if pclass == omero.rtypes.RBoolI: