Wordpress插件访问文件夹一级

I have two plugins installed one that makes uploads in the wp-content/uploads folder and the other is a simple table. I am modifying the table in order to read the number of files inside uploads folder. As you know that makes the plugins and uploads on the same level. I used content_url("/uploads/"); to access it but there is more to it. Here is my simple code:

 $dir = content_url("/uploads/");

    if (is_dir($dir)) 
    {
        foreach(glob($dir) as $file) 
        {
            echo filetype($file) . "<br />";
        }
    }

The question is how can i access the uploads folder from my plugin?

Thanks

You can find this with wp_upload_dir().

<?php $upload_dir = wp_upload_dir(); ?>

Function reference is here. http://codex.wordpress.org/Function_Reference/wp_upload_dir