File Upload

RSform!Pro upload field

Standard HTML input upload field with the following configuration tabs:

Note:

You can only upload one file with a File Upload component, but you can have an unlimited number of these components in a form.

General

  • Name: the name of the form component. This needs to be unique for each form. It can contain only alphanumeric chars. The name of the field is only used for internal reference - it will not be displayed in the front-end area.
  • Caption: the caption or label is the text or HTML that is being displayed in the actual form.
  • Description: text/HTML area that provides a description of the field. This can be useful for providing explanations or indications for that particular field.

Validations

  • As a validation rule, this can only be set to be Required or not.
  • Validation Message: text / HTML area that will allow you to set up a message that will be displayed if the field validation fails.

Attributes

The Attributes area allows you to add JavaScripts triggers, custom style (for that particular field), impose size restrictions, etc. Anything filled in this area, will be added directly to the HTML tag.

  • File size: the maximum size of an accepted file. This should be specified in KB.
  • Accepted Extensions: in this field you can configure the accepted file extensions. Simply specify an extension and press enter to specify another, eg. jpg png
  • Destination: the path to the upload folder.
  • File prefix: to prevent file replacements in the upload folder, RSForm!Pro adds a random prefix to the uploaded file names. If you specify a prefix - this will be added instead. Note that you can also use a PHP code to generate the prefix dynamically. This should be specified in between the //<code> and //</code>, example:
    //<code>
    return $_POST['form']['name_field'];
    //</code>
  • Attach file to: the file can be attached to the User, Admin emails and as well as to the configured Additional Emails.
  • File size: the maximum size of an accepted file. This should be specified in KB.
  • Additional Attributes: anything filled in this area, will be added directly to the HTML input tag. For example:
    JavaScript: onchange="your_function();" - this will trigger a JavaScript function when you upload a file.
    CSS: style="margin-left:20px" - this will set a 20px margin on the left side.

File Upload placeholders:

  1. Regular placeholders
    • {your_field_name:value} - returns a direct download link of the file.
    • {your_field_name:caption} - returns the configured field caption.
  2. Specific placeholders
    • {your_field_name:path} - This will return the direct access URL for the file. Useful to show the uploaded image within the Thank You Message page for example (eg. http://www.your-website.com/path/to/uploaded/image.png).
    • {your_field_name:localpath} - This will be replaced with the local path of the file found on the server(eg. /home/public_html/path/to/uploaded/image.jpg). This can also be used with the PDF Plugin, you can add the value of your file Upload Fields in the PDF attachment.
    • {your_field_name:filename} - You can use this placeholder in order to return the name of the uploaded file exactly as it is saved in the database.
  3. These specific placeholders are only available for the latest RSForm!Pro revisions. You can read the changelog here.


28 persons found this article helpful.


Was this article helpful?

Yes No
Sorry about that