AnsweredAssumed Answered

Enable multiple file for file field in sugar 7

Question asked by cfton cfton on Apr 8, 2015
Latest reply on Apr 8, 2015 by cfton cfton
Hi,
I tried to mimic file field in sugarcrm7.5 and enable multiple file upload for notes module, but I couldn't!
Is there any way to enable multiple file upload file for "file custom field" in sugar 7.5?

I did following activities :
1-Add multiple feature for <input type="file"..> in edit.hbs  by adding following code :
<input type="file" name="{{name}}"{{#if def.tabindex}} tabindex="{{def.tabindex}}"{{/if}} multiple="multiple" />
It's getting more than one file but only one of them (last one) is storing in the database and for note

2-I tried to add more input by adding javascript code in custom field controller by doing following codes :

events: {...
'click [id=add_more]':'addMoreUpload',
}
...
addMoreUpload: function(){
    var scntDiv = $('#p_scents');
    var i = $('#p_scents p').size() + 1;
    $('<p><label for="p_scnts"><input type="file" id="p_scnt" size="20" name="filename[]" value="" placeholder="Input Value" /></label> <a href="#" id="remScnt">Remove</a></p>').appendTo(scntDiv);
    i++;
    return false;
}
...
Although it adding <input type="file" name="<name of field>"...
But value is still getting single file name rather than getting arrays of file name.
Although in file controller it mentioned that having arrays of file names are possible for value, I don't know how may I do that.
I mimic jssource->src_files->client->base->fields->file->file.js


Cheers,
Cfton.

Outcomes