You are viewing limited content. For full access, please sign in.

Question

Question

File upload retrieval

asked on December 11, 2014 Show version history

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.

1 0

Replies

replied on December 11, 2014

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.

0 0
replied on December 11, 2014

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. 

0 0
replied on December 14, 2014 Show version history

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();
});

 

1 0
replied on December 26, 2014

Hi Xiang ,

Thanks for the code, unfortunately it seems the java script  didn't work. I see blank x image after the form title.  I already change the  location of the server using of mine as:

$('<tr><td colspan="6"><img width="300px" src="http://DDS-Cherry/Forms/handlers/downloadattachment.ashx?req=DownLoad&aid=' +aid +'&authkey=' + uqid + '"></td></tr>').insertAfter($('#cf-formtitle'));

 

but still it doesn't work, I also see some red fonts in my java script inside my forms, please see attachment.  I might have some errors.

 

  

 

replied on December 27, 2014 Show version history

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!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.