File Upload: option to rename the file name uploaded on the form

  • auricenergy
    Asked on November 11, 2019 at 7:44 PM
    2. Provide a way for dynamically acquiring the file type/extension of the uploaded file so that can be retained for specifying the destination filename. This would only require another variable for filetype be made available to reference inside flow for each file upload field present.
    Would also be good if an option existed in the form settings that would just always rename any uploaded file to match the name of the field it was uploaded to (and then just number them for multiples or something) along with the appropriate source file type/extension.
  • KrisLei Jotform Support
    Replied on November 11, 2019 at 8:11 PM

    Hi,

    2. Provide a way for dynamically acquiring the file type/extension of the uploaded file so that can be retained for specifying the destination filename. This would only require another variable for filetype be made available to reference inside flow for each file upload field present.

    To understand it clearly, you would like to have an option to allow certain file types on the Upload widget? I think there's a workaround for this, you can have multiple Uploaded File Widget on your form and you can allow certain file types on each widget on the settings.

    For your reference: How-to-Change-the-Allowed-File-Types-in-the-Upload-Field

    Would also be good if an option existed in the form settings that would just always rename any uploaded file to match the name of the field it was uploaded to (and then just number them for multiples or something) along with the appropriate source file type/extension.

    I have to escalate another ticket request for this option because it is not possible to form users to rename the files before submission or uploading it on the widget.

  • auricenergy
    Replied on November 12, 2019 at 9:46 AM

    Multiple fields is not a clean way to go since I would have to make them all optional to accommodate all the various file types. I just want jotform to pass the uploaded file's extension as a variable to FLOW for use in naming the destination file.
    I was actually just able to find a better workaround within flow that grabs the file's extension, and then lets me use that in naming the destination file.
    See picture attached - the pink expression has the following value, where the underlined part is just the jotform variable for the attachment. This essentially just gets the characters after the last period in the original filename/URL:
    last(split(triggerBody()?['11 - Attach receipt(s)'], '.'))

    In terms of the second thing, I am now using flow to rename them to what i want, but before i changed to this method, I was using Gdrive and Dropbox integrations to upload the attachments there, so it would just be helpful if you provided an option in the form settings for JOTFORM to rename uploads to something uniform AFTER the user uploads them, so it is clear which field each file was uploaded to. This should be done by jotform AFTER the user uploads their file.


    1573569932jotform Screenshot 10


  • David JotForm Support Manager
    Replied on November 12, 2019 at 10:14 AM

    Glad to know that you found a workaround to grab the file extension.

    In regards to renaming the files after users uploads them, if such an option is implemented in the future, you will be updated here.