Can the Laserfiche form retrieve the file uploaded image or the HTML field activity using of lookup rules? Since the File upload field cannot view the image that we are uploading, we were planning to use the html field as an alternative however we want to store the html data file image also in our SQL so we can retrieve the image using of the lookup rules. Please let us know if this possible before we make the changes in our Forms.
Question
Question
Replies
If you use custom HTML to upload file, the data won't be saved in the database of Forms. I think you can still use file upload field to upload file, then use some customized JavaScript to download the uploaded images from the file upload field and display in an custom HTML to archive this.
If I use the Upload File Field can I save the file to our SQL and is there a possibility to retrieve the image files in the lookup rules. All we want is to quickly preview the image that was uploaded previously in LF forms therefore the user can have an initial preview of the attached image.
Forms itself will save the attached files for file upload field into the Forms database, but the lookup rules in forms doesn't support retrieve the file data for the data is stored as binary type. You can use JavaScript to download the uploaded files and display, following is the sample:
$(document).ready(function() { var imgsrc= $(this).find("a").attr('href'); function checkDOMChange() { var aid = ''; $.each($('.files input'), function(i,e){ if($(e).val() != ''){ aid = $(e).val(); return false; } }); if(aid != ''){ var uqid = $('[name=uqid]').val(); $('<tr><td colspan="6"><img width="300px" src="http://formsserver/Forms/handlers/downloadattachment.ashx?req=DownLoad&aid=' +aid +'&authkey=' + uqid + '"></td></tr>').insertAfter($('#cf-formtitle')); } else setTimeout( checkDOMChange, 100 ); } checkDOMChange(); });
Hi Xiang it works well, however the image set after the Form Title and we want to move its location at the bottom left corner of our forms beside the file uploaded field. Any recommendation are much appreciate. Thanks!