Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Display preview assets

edited March 12 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.

Comments

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

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

    or

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

    and i can only see the overwrite option nothing else.
  • edited 7:11PM
    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 7:11PM
    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 7:11PM
    I'm sorry but I don't quite understand your question.
  • edited 7:11PM
    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 7:11PM
    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:
    http://docs.getfuelcms.com/general/models#hooks
Sign In or Register to comment.