Display preview assets

edited March 2018 in Feature Requests
Hello admin.

This time i'm trying to display a preview when you're uploading an image.

I'm using 'display_preview' but i don't know where the preview is displaying. Altought i have this property in TRUE i can't see the preview in the modal Assets > Upload.

Thanks for your help.


  • edited 8:17PM
    The preview should be displaying right by the form input field. Are you seeing any errors in the browser console?
  • edited 8:17PM
    Nothing in console. I have the property like this:

    $fields['userfile']['display_preview']= TRUE;


    $fields['userfile'] = array('type' => 'file' , 'overwrite' => TRUE, 'display_preview' => 'TRUE');

    and i can only see the overwrite option nothing else.
  • edited 8:17PM
    I think in your case, you need to specify either a "folder" or "upload_path" parameter. The folder is relative to the /assets directory whereas the upload_path is the server path to upload to.
  • edited 8:17PM
    How can i obtain the name that appear in the file type form? First appear a message that says 'ningun archivo seleccionado' and it changes automatically when i choose an image.
  • edited 8:17PM
    I'm sorry but I don't quite understand your question.
  • edited 8:17PM
    It's ok.

    In the modal Assets > Upload. When you select an image the name of the image appear in the file field. I want to capture that name in a different variable. I hope you understand, thanks admin.
  • edited 8:17PM
    Are you wanting to do this with Javascript or PHP? Also, what are you wanting to do with that file name? If you are wanting to perhaps do something with the file itself, there are on_after_post model hooks you can use to further manipulate things on save:
Sign In or Register to comment.