Is there a way to do a live preview of an image file?

Hello everyone, 

 

I was wondering if there is a way to display an image that a user uploads before the form has been submitted? 

 

Thanks,

-Seth

  Discussion posts and replies are publicly visible

Parents
  • Yes you can achieve this. Say ri!img is the variable you are saving the image uploaded by user into. Use a!imageField() to display the same image in the UI...make the size as THUMBNAIL or SMALL.As soon as the user uploads an image this a!imageField should display the image icon and on click of that one can preview whatever image is uploaded. If you don't want to click just keep the size as STANDARD and image preview can be done.
Reply
  • Yes you can achieve this. Say ri!img is the variable you are saving the image uploaded by user into. Use a!imageField() to display the same image in the UI...make the size as THUMBNAIL or SMALL.As soon as the user uploads an image this a!imageField should display the image icon and on click of that one can preview whatever image is uploaded. If you don't want to click just keep the size as STANDARD and image preview can be done.
Children