<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Adding filesize to admin notification email.</title>
		<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email</link>
		<description>Gravity Support Forums Topic: Adding filesize to admin notification email.</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 01:30:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/adding-filesize-to-admin-notification-email" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-61574</link>
			<pubDate>Wed, 06 Jun 2012 08:01:08 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">61574@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I think you want something more like:&#60;br /&#62;
gform_update_meta($entry['id'], &#34;contentlength&#34;, $contentLength);&#60;br /&#62;
You want it to be: Entry ID, Meta Key, New Value.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>seahoss on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-61549</link>
			<pubDate>Tue, 05 Jun 2012 22:02:57 +0000</pubDate>
			<dc:creator>seahoss</dc:creator>
			<guid isPermaLink="false">61549@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry to ask again, but I am still waiting on an answer on this. Much appreciated in advance :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>seahoss on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-61062</link>
			<pubDate>Thu, 31 May 2012 21:39:19 +0000</pubDate>
			<dc:creator>seahoss</dc:creator>
			<guid isPermaLink="false">61062@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome, that hook worked great. One last step in this process though. From here I can get the file size. Now all i need to do is add that file size to the hidden field (aka $entry[22]), I try to do so by the following gravity form function: ($contentLength is declared right before this, and outputs itself as an int, hence the string conversion) &#60;/p&#62;
&#60;p&#62;gform_update_meta($entry[22], '22' , (string)$contentLength); &#60;/p&#62;
&#60;p&#62;This doesnt seem to do anything, yet I believe its all in the correct format.&#60;br /&#62;
I also went to the form itself and checked off &#34;Allow field to be populated dynamically&#34; and put &#34;contentLength&#34; as the parameter(is this the correct procedure?) . Any insight would be great! Thanks again for the help so far / in advance
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-60697</link>
			<pubDate>Tue, 29 May 2012 21:34:50 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">60697@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Sorry, you can't get the size of the file because it isn't uploaded until the form is submitted. This hook might help though:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_entry_created&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_entry_created&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;It is fired after the lead has been created, but before the post has been created, notifications have been sent and the confirmation has been processed.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>seahoss on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-60689</link>
			<pubDate>Tue, 29 May 2012 19:48:12 +0000</pubDate>
			<dc:creator>seahoss</dc:creator>
			<guid isPermaLink="false">60689@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Any update on this? I am a little stranded right now :/
&#60;/p&#62;</description>
		</item>
		<item>
			<title>seahoss on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-59900</link>
			<pubDate>Tue, 22 May 2012 13:52:14 +0000</pubDate>
			<dc:creator>seahoss</dc:creator>
			<guid isPermaLink="false">59900@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;When I do a print_r($_POST) I see no variables that have a link as a value. I see what appears to be two encrypted looking values which are as follows which I suspect may be the link? :&#60;br /&#62;
[gform_unique_id] =&#38;gt; 4fbbd018c285b [state_3] =&#38;gt;     YToyOntpOjA7czo2OiJhOjA6e30iO2k6MTtzOjMyOiIwY2U0NGU1ZjQxZDdkYmM4MGMwMzlmOTg0OTk1NWY3ZCI7fQ==&#60;/p&#62;
&#60;p&#62;Is there an example of code you can provide that shows how to get the link inside of this pre_submission hook? Thanks again!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-59467</link>
			<pubDate>Fri, 18 May 2012 17:26:00 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">59467@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You should be able to get it via the Post variable and its field ID like what is in the documentation page:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>seahoss on "Adding filesize to admin notification email."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-filesize-to-admin-notification-email#post-59466</link>
			<pubDate>Fri, 18 May 2012 17:12:26 +0000</pubDate>
			<dc:creator>seahoss</dc:creator>
			<guid isPermaLink="false">59466@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi all,&#60;br /&#62;
   I am posting here to see if any of you can help with my problem. I have a client who would like to receive the file size of uploaded images directly in the admin notification email after a form submission. &#60;/p&#62;
&#60;p&#62;  I have done the following: I added a  hidden 'File Size' field on the form. I also added an addaction for gform_pre_submission.  This is shown in the pasted code. So my plan here is inside the function that is called by the gform_submission I will had a php filesize to get the size in bytes of that file, and then change the value of the filesize input. &#60;/p&#62;
&#60;p&#62;My problem is I can not for the life of my figure out how to get the URL of the file inside this function. I figured out how to do it in the gform_post_submission hook, but by this hook the email has all ready sent :/ . I feel there must be a way to do this since the email sends a link directly to the file, i just cant find out where this is happening. Any suggestions here?  Much appreciated in advance.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;//Gravity Forms include File Size In Admin Notification Email
add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;pre_submission_handler&#38;quot;);
                function pre_submission_handler($entry, $form){
                /*
                How Do I Get $url here?

                $fileSize = filesize($url);
                if ($fileSize &#38;lt; 1024) {
        echo $fileSize .&#38;#39; B&#38;#39;;
                } elseif ($fileSize &#38;lt; 1048576) {
                        echo round($fileSize / 1024, 2) .&#38;#39; KB&#38;#39;;
                } elseif ($fileSize &#38;lt; 1073741824) {
                        echo round($fileSize / 1048576, 2) . &#38;#39; MB&#38;#39;;
                }*/
                        $_POST[&#38;#39;input_22&#38;#39;] = &#38;#39;SizeHere&#38;#39;;
                }

//This is the working hook/filter, its just too late to change the field name since the file has all ready been sent.
add_action(&#38;quot;gform_post_submission&#38;quot;, &#38;quot;post_sendmail_handler&#38;quot;, 10, 2);
                function post_sendmail_handler($entry, $form){
                        $url = $entry[2];

                }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
