Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
d2a9b67b
Commit
d2a9b67b
authored
Mar 30, 2009
by
Richard Mansfield
Browse files
Always post 'upload' param when attempting to upload a file
parent
13b57e36
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/form/elements/filebrowser.php
View file @
d2a9b67b
...
...
@@ -243,7 +243,7 @@ function pieform_element_filebrowser_doupdate(Pieform $form, $element) {
'folder'
=>
$folder
,
));
}
else
if
(
!
empty
(
$_POST
[
'upload'
])
||
(
isset
(
$_FILES
[
'userfile'
]))
)
{
else
if
(
!
empty
(
$_POST
[
'upload'
]))
{
if
(
!
isset
(
$_FILES
[
'userfile'
][
'name'
]))
{
return
array
(
'error'
=>
true
,
...
...
htdocs/artefact/file/js/filebrowser.js
View file @
d2a9b67b
...
...
@@ -31,6 +31,9 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
setNodeAttribute
(
self
.
id
+
'
_userfile
'
,
'
disabled
'
,
true
);
addElementClass
(
self
.
id
+
'
_uploadcancel
'
,
'
hidden
'
);
}
if
(
!
self
.
form
.
upload
)
{
appendChildNodes
(
self
.
form
,
INPUT
({
'
type
'
:
'
hidden
'
,
'
name
'
:
'
upload
'
,
'
value
'
:
0
}));
}
self
.
upload_connectbuttons
();
}
...
...
@@ -85,11 +88,13 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
}
self
.
upload_presubmit
();
self
.
form
.
upload
.
value
=
1
;
signal
(
self
.
form
,
'
onsubmit
'
);
self
.
form
.
submit
();
// $(self.id + '_userfile').value = ''; // Won't work in IE
replaceChildNodes
(
self
.
id
+
'
_userfile_container
'
,
INPUT
({
'
type
'
:
'
file
'
,
'
class
'
:
'
file
'
,
'
id
'
:
self
.
id
+
'
_userfile
'
,
'
name
'
:
'
userfile
'
,
'
size
'
:
40
}));
connect
(
self
.
id
+
'
_userfile
'
,
'
onchange
'
,
self
.
upload_submit
);
self
.
form
.
upload
.
value
=
0
;
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment