File Uploader filename?

fabrik_83

New Member
Hello,
I'm uploading files for students and would like to have a field for either uploaded filename or added filename using an additional text field. This should be doable if I allow only one file upload at a time to correspond filename with each record/upload, but I don't know if this is possible when I'm using Ajax upload form for multiple file uploads. Is this possible through any Fabrik plugins? Thanks.
 
Hi, I thought I'd share my partial solution to this– just added simple jQuery script that grabs the file name from rendered Frabrik uploader display element's attribute, title, and added it to the link.

jQuery('li .download-archive').each(function(){
var $filename = jQuery(this).attr('title') ;
jQuery(this).append($filename);
});


This works fine if I don't need to change the name of file uploaded, but I would like to see if there is a way to add custom file name at time of upload, or afterwards.
 
PS I'm looking to add linked file name field in addition to keeping original file name, not change file name with Rename code field, and for multiple file uploads. Thanks.
 
I'm not sure what you mean.

Do you need to somehow "pre name" the upload? Or do you want to grab the uploaded filename and stick it in a field element?

-- hugh
 
Hi Hugh,
Yes, the later: put file name in field element that client can edit to make it more user friendly and semantic for students.
 
OK. One thing you could try is to put some code in the 'rename' option. Don't change it (so just return it unchanged), and as a side-effect set the field you want. The filename is in $filename, and you can use the usual $formModel methods, so something like ...

Code:
$formModel->updateFormData('yourtable___name', $filename, true);
return $filename;

Replace yourtable___name with the full element name of the field you want to update.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top