Search code examples
vtiger

Remove prefix for upload image in Vtiger


When upload image, vtiger add prefix to filename.

Befor upload: IMG_NAME.png. 
After upload: 26540_IMG_NAME.png.

How I can remove '26540_' prefix?


Solution

  • Its not recommended to change the standard of storing files with the name. Because the prefix ('26540_' in your case) is the unique identifier which will add before the filename. And if we upload same file with the same name vTiger treat as a different file.

    But still if you dont want to prefix added then customize the code as per below:

    1. Open \data\CRMEntity.php
    2. Search function uploadAndSaveFile(
    3. Comment the line

      $upload_status = move_uploaded_file($filetmp_name, $upload_file_path .$current_id . "_" .  $binFile);
      
    4. Add (Removed $current_id)

      $upload_status = move_uploaded_file($filetmp_name, $upload_file_path .  $binFile);
      

    Save the script and test. Cheers!