This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Displaying images on review page and limiiting file uploads


  1. takemura
    Member

    I want to use the file upload function for photos (jpegs). How can I make it so a thumbnail of the photo uploaded appears on the 'review' page?

    It would also be good if a thumbnail also appeared on the submission page when they go back.

    I would also like to know how I can limit the number of files that can be uploaded as there's no provision for this in the field properties screen.

    Also, I would like to limit the size of the photos uploaded. How can this be achieved?

    p.s. I think you should introduce categories in your forum as it would make it easier for us to find specific posts.

    Posted 14 years ago #
  2. redityo

    It's possible to show uploaded file in review page and create a limitation for the file size. You need to customize some files for this, for showing the image on review page, you can follow to these steps :

    1. Edit "includes/entry-functions.php" file and go to around line 383, you'll see these code :

    $file_1 	    =  substr($filename_value,strpos($filename_value,'-')+1);

    then put this code exactly above that line

    $filename_basic = $filename_value ;

    2. Go to around line 406 ~ 408 for these code :

    if(!empty($options['show_attach_image'])){
    	$entry_details[$i]['value'] = '<img src="'.$options['machform_path'].'images/icons/attach.gif" align="absmiddle" />&nbsp;'.$filename_value;
    }

    then put these code exactly bellow that code

    if(!empty($options['show_image_directly'])){
    	$entry_details[$i]['value'] = '<img width="200px" height="200px" src="http'.$ssl_suffix.'://'. $_SERVER['HTTP_HOST'] .dirname($_SERVER['PHP_SELF']) .  '/data/form_' . $form_id . '/files/'.  $filename_basic  . '.tmp" /> ';
    }

    3. Edit "includes/view-functions.php" file, in line 2326 you'll see this code

    $param['show_attach_image']   = true;

    then put this code bellow that line

    $param['show_image_directly']   = true;

    And to limit upload file size, you can use the method that posted in here :

    http://www.appnitro.com/forums/topic/file-size-error-message?replies=7#post-4082


    MachForm Support

    Posted 14 years ago #

RSS feed for this topic

Reply