<?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: Displaying uploaded file contents in a multipage form</title>
		<link>https://legacy.forums.gravityhelp.com/topic/displaying-uploaded-file-contents-in-a-multipage-form</link>
		<description>Gravity Support Forums Topic: Displaying uploaded file contents in a multipage form</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Apr 2026 17:12:50 +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/displaying-uploaded-file-contents-in-a-multipage-form" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Displaying uploaded file contents in a multipage form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/displaying-uploaded-file-contents-in-a-multipage-form#post-39269</link>
			<pubDate>Fri, 28 Oct 2011 17:30:31 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">39269@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Vladdie,&#60;/p&#62;
&#60;p&#62;Unfortunately we can't document every line of code in Gravity Forms but we're always more than happy to point the way when asked. Glad you were able to get this working! :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vladdie1979 on "Displaying uploaded file contents in a multipage form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/displaying-uploaded-file-contents-in-a-multipage-form#post-39142</link>
			<pubDate>Thu, 27 Oct 2011 16:08:16 +0000</pubDate>
			<dc:creator>vladdie1979</dc:creator>
			<guid isPermaLink="false">39142@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;David, thank you so much!&#60;br /&#62;
The default values are pre-filled like a snap now with the gform_pre_render hook.&#60;br /&#62;
Sadly, the approach you suggested to get temp file contents (via RGFormsModel::get_upload_path and RGFormsModel::get_temp_filename ) is not documented.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Displaying uploaded file contents in a multipage form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/displaying-uploaded-file-contents-in-a-multipage-form#post-39037</link>
			<pubDate>Wed, 26 Oct 2011 18:34:45 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">39037@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Vladdie,&#60;/p&#62;
&#60;p&#62;You actually don't have to mess with the core code at all. You can get the contents of the file right from the gform_pre_render hook (and potentially the gform_field_value hook, didn't test that though). Here is some sample code:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/2764573&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2764573&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vladdie1979 on "Displaying uploaded file contents in a multipage form"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/displaying-uploaded-file-contents-in-a-multipage-form#post-39030</link>
			<pubDate>Wed, 26 Oct 2011 17:51:46 +0000</pubDate>
			<dc:creator>vladdie1979</dc:creator>
			<guid isPermaLink="false">39030@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I posted this question in a brief form a few days ago at &#60;a href=&#34;http://www.gravityhelp.com/forums/topic/displaying-uploaded-file-contents-before-submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/displaying-uploaded-file-contents-before-submission&#60;/a&#62; , but it must have been overlooked by the gurus.&#60;br /&#62;
So, once again.&#60;br /&#62;
I am looking to implement the following:&#60;br /&#62;
In a multipage form, the user uploads a plain text file at, say, 1st page. Presses &#34;next page&#34;.&#60;br /&#62;
Then the contents of the file is parsed by a custom function and populates a field/fields on the 2nd page.&#60;/p&#62;
&#60;p&#62;Here's what I tried:&#60;br /&#62;
I have not found any hooks to grab the temporart uploaded file, so I hacked in a custom function call in the upload_files function in the form_display.php file, like this:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;file_contents_to_POST ($target_path, $file_info);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The function does grab the file contents allright:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function file_contents_to_POST ($filepath, $file_name_info) {
 if (pathinfo ($file_name_info [&#38;quot;temp_filename&#38;quot;], PATHINFO_EXTENSION) == &#38;quot;tmx&#38;quot;) {	//check if it is a tmx-file
   $full_filename = $filepath . $file_name_info [&#38;quot;temp_filename&#38;quot;];
   $file_contents_object = new SimpleXMLElement (file_get_contents ($full_filename));
   $TU0 = $file_contents_object-&#38;gt;{&#38;quot;body&#38;quot;}-&#38;gt;{&#38;quot;tu&#38;quot;}[0]; //string
   $_POST [&#38;quot;TMX_file&#38;quot;] = $TU0;
 }
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I can't find a way to use the $_POST [&#34;TMX_file&#34;] contents to populate fields on the 2nd page.&#60;br /&#62;
I tried the gform_field_value filter, the gform_pre_render filter. Doesn't work.&#60;br /&#62;
So, I basically have two questions now:&#60;br /&#62;
1) Am I taking a reasonable approach to grab the file contents? Or is there a simpler way to do what I'm aimimg at.&#60;br /&#62;
2) Why are the filters not getting the $_POST contents? What am I doing wrong here? Should I store the file contents in a different way instead of $_POST?&#60;/p&#62;
&#60;p&#62;Thanks in advance
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
