We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I have the problem. I need to upload some files (I don't know how many). And I added inputs dynamically.
'changeListener': function(parent){ if(jVal.attaches < 10) { jVal.attaches++; var att = jVal.attaches; var newElement = $(''); $('#response-form > .attach-form > .attach-inputs').append(newElement); newElement.change(function(){jVal.changeListener(this)}); $(newElement).ajaxfileupload({ 'action': "/index.php?option=com_consulting&task=addAttach&attachID=" + att, 'submit_button': $('#response-form > .attach-form > #sendAttach'), 'params': {'questionID': jVal.requestID}, 'onStart': function() { console.log('starting upload' + att); console.log(this);}, }); } }, And when I try to upload files by pressing #sendAttach button, I get this log messages:
starting upload Object[input#firstattach.custom_inp] starting upload2 Object[input.custom_inp] starting upload3 Object[input.custom_inp] got response: (empty string) Object[input.custom_inp] got response: (empty string) Object[input.custom_inp] got response: logo4w.png 11 attach3
So, only the last file uploaded correctly. This is code to safe files:
$aid = JRequest::getVar('attachID'); $fname = 'attach' . $aid; move_uploaded_file($_FILES[$fname]["tmp_name"], JPATH_SITE.'/upload/' . basename($_FILES[$fname]['name'])); echo $_FILES[$fname]['name'] . " 11 $fname";
What's wrong?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi. I have the problem. I need to upload some files (I don't know how many). And I added inputs dynamically.
'changeListener': function(parent){
if(jVal.attaches < 10)
{
jVal.attaches++;
var att = jVal.attaches;
var newElement = $('');
$('#response-form > .attach-form > .attach-inputs').append(newElement);
newElement.change(function(){jVal.changeListener(this)});
$(newElement).ajaxfileupload({
'action': "/index.php?option=com_consulting&task=addAttach&attachID=" + att,
'submit_button': $('#response-form > .attach-form > #sendAttach'),
'params': {'questionID': jVal.requestID},
'onStart': function() { console.log('starting upload' + att); console.log(this);},
});
}
},
And when I try to upload files by pressing #sendAttach button, I get this log messages:
starting upload
Object[input#firstattach.custom_inp]
starting upload2
Object[input.custom_inp]
starting upload3
Object[input.custom_inp]
got response:
(empty string)
Object[input.custom_inp]
got response:
(empty string)
Object[input.custom_inp]
got response:
logo4w.png 11 attach3
So, only the last file uploaded correctly. This is code to safe files:
$aid = JRequest::getVar('attachID');
$fname = 'attach' . $aid;
move_uploaded_file($_FILES[$fname]["tmp_name"], JPATH_SITE.'/upload/' . basename($_FILES[$fname]['name']));
echo $_FILES[$fname]['name'] . " 11 $fname";
What's wrong?
The text was updated successfully, but these errors were encountered: