Commit a86bb04f authored by Nigel McNie's avatar Nigel McNie
Browse files

Make uploading a file into a View work in Chrome/Safari.



Turns out they don't send through the upload button as it's in a
<noscript> element.
Signed-off-by: default avatarNigel McNie <nigel@catalyst.net.nz>
parent 32190f5a
......@@ -462,16 +462,21 @@ function pieform_element_filebrowser_doupdate(Pieform $form, $element) {
));
}
// {$prefix}_upload is set in all browsers except safari when javascript is
// on (and set in all browsers when it's not)
$upload = param_variable($prefix . '_upload', null);
if (!empty($upload)) {
if (!isset($_FILES['userfile']['name'])) {
if (empty($_FILES['userfile']['name'])) {
return array(
'error' => true,
'message' => get_string('filenamefieldisrequired', 'artefact.file'),
'browse' => 1,
);
}
else if (strlen($_FILES['userfile']['name']) > 1024) {
}
if (isset($_FILES['userfile']['error']) && $_FILES['userfile']['error'] == 0) {
if (strlen($_FILES['userfile']['name']) > 1024) {
return array(
'error' => true,
'message' => get_string('nametoolong', 'artefact.file'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment