アップロードファイルの名称/タイプ/サイズを取得する

  • 作成者:ayuan0625
  • 編集回数:8次
  • 最終更新:FRInternational 于 2021-06-01
  • I. Description

    In the data entry report, when uploading a file using the file widget, the file name, file type and file size can be obtained through formulas.

    filename(file): get the file name;

    filetype(file): get the file type;

    filesize(file): Get the file size.

    Regardless of uploading one or more files, the return value of the formula is an array.

    Note: Only files uploaded through the file widget are supported, and files stored in the database are not supported.

    II. Example

    1. filename(file)

    The function is to get the name of the uploaded file, and the file parameter is the number of the cell where the file widget is located.

    As shown in the figure below, create a new template, add a file widget in cell B2, and enter the formula =filename(B2) in cell C2. Click Data Entry Preview, click the file widget, upload a jpg file, the effect is as shown in the figure below:

    1.png


    2. filetype(file)

    The function is to obtain the type of the uploaded file, and the file parameter is the number of the cell where the file widget is located.

    Enter =filetype(B2) in cell D2 of the previous template. Click Data Entry Preview, click the file widget to upload a jpg file, the effect is as shown in the figure below:

    2.png


    3. filesize(file)

    The function is to get the size of the uploaded file, the unit is KB, and the file parameter is the number of the cell where the file widget is located.

    Enter the formula =filesize(B2) in cell E2 of the previous template. Click Data Entry Preview, click the file widget to upload a jpg file, the effect is as shown in the figure below:

    3.png

    III. Download template

    Click to download:

    Get_file_info.cpt


    Attachment List


    Theme: FineReport パラメータ
    既に最初
    既に最後
    • Helpful
    • Not helpful
    • Only read