diff --git a/code/Forms/UploadField.php b/code/Forms/UploadField.php
index 3417880ee..2f235b368 100644
--- a/code/Forms/UploadField.php
+++ b/code/Forms/UploadField.php
@@ -288,8 +288,6 @@ public function getAttributes()
'type' => 'file',
'multiple' => $this->getIsMultiUpload(),
'id' => $this->ID(),
- 'data-schema' => json_encode($this->getSchemaData()),
- 'data-state' => json_encode($this->getSchemaState()),
);
$attributes = array_merge($attributes, $this->attributes);
diff --git a/templates/SilverStripe/AssetAdmin/Forms/UploadField.ss b/templates/SilverStripe/AssetAdmin/Forms/UploadField.ss
index 0868a5074..02e850c46 100644
--- a/templates/SilverStripe/AssetAdmin/Forms/UploadField.ss
+++ b/templates/SilverStripe/AssetAdmin/Forms/UploadField.ss
@@ -7,4 +7,4 @@
<% end_if %>
- />
+ data-schema="$SchemaData.JSON" data-state="$SchemaState.JSON" />