Hi,
I have a question. I want to enable multiple files upload. I will not be
using any jQuery/ajax script. I am using HTML5 multiple attribute on my
input field, and then. Html 5 File API just for displaying files below my
form.
$(".upload").change(function(evt) {
var button = $(this);
var files = evt.target.files;
button.next("ul.new").remove();
var output = [];
for (var i = 0, f; f = files[i]; i++) {
output.push('<li><strong>', f.name, '</li>');
}
button.after('<ul class="files new">' + output.join('') + '</ul>');
})
In my form i want to have a field names attachment[] instead of attachment,
so i can receive multiple files. When i add [] to my file input name i
receive an error:
<type 'exceptions.SyntaxError'> invalid table or field name: attachment[]
If i try to upload multiple files without changing the name, i receive an
error:
<type 'exceptions.UnboundLocalError'> local variable 'source_file'
referenced before assignment
How could i do this?
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.