<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: File Uploading</title>
  <link>http://www.activecollab.com/forums/topic/1004/</link>
  <description>Recent posts on topic: File Uploading</description>
  <dc:language>en-us</dc:language>
  <pubDate>Sun, 23 Nov 2008 12:46:38 UTC</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/13140/#post13140</link>
    <guid>http://www.activecollab.com/forums/post/13140/#post13140</guid>
    <title>Post #15 by alexkingorg</title>
    <dc:creator>alexkingorg</dc:creator>
    <description><![CDATA[<p>The function above didn't work for me (CentOS), but this did. It's PHP5 only due to the strrpos usage - that could likely be replaced with strpos with no ill effects for PHP4 users.<br />
<pre name="code" class="html">  function force_mkdir($path, $chmod = null) {
    if (is_dir($path)) {
      return true;
    } // if
    $real_path = str_replace('\\', '/', $path);
    $parts = explode('/', $real_path);
    
    $forced_path = '';
    $path_start = strrpos($path, 'upload');
    foreach ($parts as $part) {
      if (empty($part)) {
        continue;
      }
      
      // Skip first on windows
      if ($forced_path == '') {
        $start = substr(__FILE__, 0, 1) == '/' ? '/' : '';
        $forced_path = $start . $part;
      } else {
        $forced_path .= '/' . $part;
      } // if
      
      if (strlen($forced_path) &gt; $path_start &amp;&amp; !is_dir($forced_path)) {
        if (!is_null($chmod)) {
          if (!mkdir($forced_path)) {
      	die('test'.$forced_path);
            return false;
          } // if
        } else {
          if (!mkdir($forced_path, $chmod)) {
            return false;
          } // if
        } // if
      } // if
    } // foreach
    
    return true;
  } // force_mkdir
</pre></p>]]></description>
    <pubDate>Fri, 30 May 2008 06:53:12 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/9993/#post9993</link>
    <guid>http://www.activecollab.com/forums/post/9993/#post9993</guid>
    <title>Post #14 by takdavid</title>
    <dc:creator>takdavid</dc:creator>
    <description><![CDATA[<p>Senixon, this function doesn`t work on PHP5.1.6, Linux 2.6.18-1.2798.fc6, Apache/2.2.3 (Fedora). Nothing interesting happens, the same error occurs.<br />
</p>]]></description>
    <pubDate>Mon, 15 Oct 2007 19:26:49 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/8308/#post8308</link>
    <guid>http://www.activecollab.com/forums/post/8308/#post8308</guid>
    <title>Post #13 by adamluz2</title>
    <dc:creator>adamluz2</dc:creator>
    <description><![CDATA[<p>Above fix did not work for me. I have openbase_dir in effect. On Apache 2 with PHP 5 running Fedora Core 4, (Linux) and applied above fix. Still getting same error. All permission are correct. </p>]]></description>
    <pubDate>Fri, 27 Jul 2007 18:06:21 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/8093/#post8093</link>
    <guid>http://www.activecollab.com/forums/post/8093/#post8093</guid>
    <title>Post #12 by Anathema</title>
    <dc:creator>Anathema</dc:creator>
    <description><![CDATA[<p>@ senixon,<br />
<br />
Thanks for your solution. Now file system is running on my server well!!! :)</p>]]></description>
    <pubDate>Fri, 29 Jun 2007 20:48:20 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7978/#post7978</link>
    <guid>http://www.activecollab.com/forums/post/7978/#post7978</guid>
    <title>Post #11 by spida</title>
    <dc:creator>spida</dc:creator>
    <description><![CDATA[<p>@senixon<br />
Does your solution probably work on a *nix server?<br />
<br />
@mvdbrand<br />
Did you try it? Result?</p>]]></description>
    <pubDate>Mon, 18 Jun 2007 07:52:47 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7814/#post7814</link>
    <guid>http://www.activecollab.com/forums/post/7814/#post7814</guid>
    <title>Post #10 by senixon</title>
    <dc:creator>senixon</dc:creator>
    <description><![CDATA[<p>@mvdbrand: <br />
<br />
Are you on Windows or Lunux? What PHP version do you have?<br />
I have a solution that works perfectly on a Windows 2003 server with PHP 5.1.x, try my solution and let me know if it worked!<br />
<br />
Go into [activeCollab Intall directory]/environment/functions/files.php and replace the 'force_mkdir' function with my solution...<br />
<br />
<pre name="code" class="php">function force_mkdir($path, $chmod = null) {	
	$real_path = str_replace(getcwd(), '', $path);
	$real_path = str_replace('\\', '/', $real_path);
    if(is_dir($real_path)) return true; 
    $parts = explode('/', $real_path);
	    
	$forced_path = '';	
    foreach($parts as $part) {
      
      // Skip first on windows
      if($forced_path == '') {		
        $start = substr(__FILE__, 0, 1) == '/' ? '/' : '';
        $forced_path = $start . $part;
      } else {		
        $forced_path .= '/' . $part;
      } // if
      
      if(strlen(trim($forced_path)) &gt; 0 &amp;&amp; !is_dir($forced_path)) {
        if(!is_null($chmod)) {
          if(!mkdir($forced_path)) return false;
        } else {
          if(!mkdir($forced_path, $chmod)) return false;
        } // if
      } // if
    } // foreach
    
    return true;
  } // force_mkdir</pre></p>]]></description>
    <pubDate>Thu, 24 May 2007 16:57:45 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7667/#post7667</link>
    <guid>http://www.activecollab.com/forums/post/7667/#post7667</guid>
    <title>Post #9 by mvdbrand</title>
    <dc:creator>mvdbrand</dc:creator>
    <description><![CDATA[<p>I don't get what I have to do to fix this. Can somebody please help me.<br />
<br />
mvdbrand</p>]]></description>
    <pubDate>Mon, 07 May 2007 14:31:04 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/6322/#post6322</link>
    <guid>http://www.activecollab.com/forums/post/6322/#post6322</guid>
    <title>Post #8 by Ilija Studen</title>
    <dc:creator>Ilija Studen</dc:creator>
    <description><![CDATA[<p><div class="postQuote"><blockquote><div class="quoteAuthor">viceroy321:</div>trac is down again...</blockquote></div><br />
<br />
It keeps crashing. I asked support and they told me that they'll check it out but problem persists. I'll send another email and we'll see what happens.</p>]]></description>
    <pubDate>Thu, 01 Feb 2007 16:32:27 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/6317/#post6317</link>
    <guid>http://www.activecollab.com/forums/post/6317/#post6317</guid>
    <title>Post #7 by viceroy321</title>
    <dc:creator>viceroy321</dc:creator>
    <description><![CDATA[<p>trac is down again...</p>]]></description>
    <pubDate>Thu, 01 Feb 2007 15:59:17 UTC</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/6308/#post6308</link>
    <guid>http://www.activecollab.com/forums/post/6308/#post6308</guid>
    <title>Post #6 by interactive</title>
    <dc:creator>interactive</dc:creator>
    <description><![CDATA[<p>no fix yet ? The ticket#197 goes to an error page.</p>]]></description>
    <pubDate>Thu, 01 Feb 2007 11:25:13 UTC</pubDate>
  </item>
</channel>
</rss>