PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Upload Merge Tag Strip URL

  1. jason.hoffmann
    Member

    I have an upload field in my form. In Notifications, when I enter in the {all_fields} I get a a box with a link to the uploaded file and only the last part of the filename (i.e. Document.pdf). But, when I use the merge tag {Upload:[field_id]} I get the full URL (i.e. http://www.site.com/uploads/gravity_forms/Document.pdf) with the same link. Is there any way to show this first version, with just the uploaded documents file name without the full URL using a merge tag?

    Posted 10 years ago on Friday May 31, 2013 | Permalink
  2. rdell
    Member

    Have a similar problem to Jason. I'm using File Upload & then trying to view in the Post Body using GDE.

    [gview file="{File to upload:3}" save="0"]

    This forces a full URL "http://www.devsite.com/wp-content/uploads ...". I want to strip the http://www.devsite.com as it would ease porting to Test & Live sites.

    Posted 10 years ago on Friday June 28, 2013 | Permalink
  3. The upload field when being processed in the {all_fields} merge tag has some special handling that does not happen when using the field by itself. But, what you can do is use the gform_merge_tag filter to fix this:

    http://www.gravityhelp.com/documentation/page/Gform_merge_tag_filter

    Take a look at the code and let me know if you have questions.

    http://pastie.org/8092773

    Posted 10 years ago on Friday June 28, 2013 | Permalink

This topic has been resolved and has been closed to new replies.