<?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: Safe_mode error FAILED (Upload folder could not be created.)</title>
		<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created</link>
		<description>Gravity Support Forums Topic: Safe_mode error FAILED (Upload folder could not be created.)</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 19:58:30 +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/safe_mode-error-failed-upload-folder-could-not-be-created" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-109976</link>
			<pubDate>Fri, 28 Dec 2012 16:21:47 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">109976@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi again, I was talking to one of our developers and you are right, Safe Mode does create issues for our file uploads. Gravity Forms needs access to write to the uploads folder and there isn't really anything we can do about it. Also, Safe Mode has been deprecated and even removed from PHP 5.4 so it is probably not a good idea to depend on it anymore.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://php.net/manual/en/features.safe-mode.php&#34; rel=&#34;nofollow&#34;&#62;http://php.net/manual/en/features.safe-mode.php&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joesamcoke on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-109834</link>
			<pubDate>Fri, 28 Dec 2012 11:47:55 +0000</pubDate>
			<dc:creator>joesamcoke</dc:creator>
			<guid isPermaLink="false">109834@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for that tip. I've moved the code into my theme functions.php and updated to a vanilla copy of Gravity Forms 1.6.11 but I'm still getting the same error (line no is the only difference).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;PHP Warning:  copy(): Unable to access /var/www/mysite/wp-content/uploads/rgbtest12.jpg in /var/www/mysite/wp-content/plugins/gravityforms/forms_model.php on line 2012
PHP Warning:  copy(/var/www/mysite/wp-content/uploads/rgbtest12.jpg): failed to open stream: No such file or directory in /var/www/mysite/wp-content/plugins/gravityforms/forms_model.php on line 2012&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I've done a bit more debugging in the actual code and at the point of the copy() command on line 2012 the file does not appear to exist (i.e. adding file_exists($path) to line 2011 outputs false).&#60;br /&#62;
Similarly if I try a file upload no file is output, although I see no PHP error message.&#60;br /&#62;
This is on a standard LAMP server and only occurs when safe_mode is enabled (which I require for production use) and appears to be reproducible.&#60;br /&#62;
Please advise.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-107046</link>
			<pubDate>Mon, 24 Dec 2012 09:34:48 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">107046@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Please don't change core files. The hooks and filters code we link to belongs in your theme's functions.php file. Check out the following documentation:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joesamcoke on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-107041</link>
			<pubDate>Mon, 24 Dec 2012 09:19:12 +0000</pubDate>
			<dc:creator>joesamcoke</dc:creator>
			<guid isPermaLink="false">107041@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for the reply, I've been looking into this further but think I've misunderstood what this is doing.&#60;/p&#62;
&#60;p&#62;The code I added to the foot of forms_model.php is:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_upload_path&#38;quot;, &#38;quot;change_upload_path&#38;quot;, 10, 2);
function change_upload_path($path_info, $form_id){
    $wp_upload_dir = wp_upload_dir();
    $path_info[&#38;quot;path&#38;quot;] = $wp_upload_dir[&#38;#39;path&#38;#39;];
    $path_info[&#38;quot;url&#38;quot;] = &#38;quot;http://www.mysite.com/wp-content/uploads/&#38;quot;;
    return $path_info;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;But I'm getting a PHP warning stating:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;PHP Warning:  copy(): Unable to access /var/www/mysite/wp-content/uploads/rgbtest1.jpg in /var/www/mysite/wp-content/plugins/gravityforms/forms_model.php on line 2002
PHP Warning:  copy(/var/www/mysite/wp-content/uploads/rgbtest1.jpg): failed to open stream: No such file or directory in /var/www/mysite/wp-content/plugins/gravityforms/forms_model.php on line 2002&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If I'm reading this rightly it's now trying to copy from the uploads directory to somewhere else rather than write to the uploads directory... &#60;/p&#62;
&#60;p&#62;Any thoughts appreciated.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-104552</link>
			<pubDate>Wed, 19 Dec 2012 13:24:55 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">104552@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can use the gform_upload_path filter to change where your Gravity Forms uploads will be stored: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_upload_path&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_upload_path&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>joesamcoke on "Safe_mode error FAILED (Upload folder could not be created.)"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/safe_mode-error-failed-upload-folder-could-not-be-created#post-102733</link>
			<pubDate>Fri, 14 Dec 2012 14:32:26 +0000</pubDate>
			<dc:creator>joesamcoke</dc:creator>
			<guid isPermaLink="false">102733@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;Wordpress 3.4.4&#60;br /&#62;
Gravity Forms 1.6.8.1&#60;/p&#62;
&#60;p&#62;If I run the site with safe_mode enabled (which is unfortunately required for production, yes I know all about safe_mode!) then I am unable to use image fields because doing so the form sends a blank image and the logs report:&#60;br /&#62;
PHP Warning: copy(FAILED (Upload folder could not be created.)) function.copy: failed to open stream: No such file or directory in wp-content/plugins/gravityforms/forms_model.php on line 2002&#60;/p&#62;
&#60;p&#62;I've tried setting all the directories within wp-content to 777 and still get the same error. It appears that the problem is that when the script creates the directory it has the wrong owner and hence is unable to write to it.&#60;br /&#62;
Is it possible to not create a new folder on each upload in a similar way to how wordpress is able to not &#34;Organize my uploads into month- and year-based folders&#34;?&#60;br /&#62;
Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
