ftp uploaded files are not in the library of Media module I installed media module in Drupal 7 to browse the uploaded files on the server. I created a new field called media3 and this is its configuration.



This is the next page :



The problem is when I'm trying to add new content to this content type and select them in the library tab from media module, only the image files that are already uploaded through http protocol are displayed.

If I check the Allowed URI schemes checkbox, nothing will be displayed in the library tab.
 how do I can browse the ftp uploaded files? where they should be to be visible to media module?
The media module, like pretty much all of the file related modules on Drupal, relies on the managed files system which involves adding data to the db for files that are uploaded, simply using ftp to place them in the appropriate directory bypasses the "drupal way" and doesn't create these database rows, so the media module doesn't know about the files. I have used this method with other modules but not media:

::I do not claim that this is the best way to handle it, but it has worked for my use cases::

The following are the contents of a custom module I through together and assume a few things, first that your node type is "picture", second that you are just using the default "file" field that comes with drupal, and lastly that only files you are aware of exist in the directory "/sites/default/files/importer":

function MYMODULE_menu(){
    $info['db_pics']=array(
        'title' =&gt; 'NCD Callbacks',
        'page callback' =&gt; 'db_pics_callback',
        'access callback' =&gt; 'pics_is_admin',
    );
    return $info;
}
function pics_is_admin(){
    global $user;
    return ($user-&gt;uid==1);
}
function db_pics_callback(){
    $url='./sites/default/files/importer';
    $files=traverse($url);
    foreach($files as $source){
        $node=new stdClass();
        $node-&gt;type='picture';
        $node-&gt;uid=1;
        $node-&gt;status=1;

        //This part is optional and just allowed me to create a node using metadata from the image file
        //Get file info
        $fn=exif_read_data($source);
        if(!isset($fn['DateTime'])){
            $fn['DateTime']=$last_dt;
        }else{
            $last_dt=$fn['DateTime'];
        }

        $node-&gt;title=$fn['FileName'];
        $names[]=$node-&gt;title;
        $node-&gt;created=strtotime($fn['DateTime']);

        //Fetch the actual data from the image file
        $image = file_get_contents($source);

        // Returns the new file object after saving the image to the appropriate Drupal File schema
        $file = file_save_data($image, 'public://'.$fn['FileName'], FILE_EXISTS_RENAME);
        $node-&gt;field_image['und'][0]=(array) $file;
        node_save($node);
    }
    return '&lt;ul&gt;&lt;li&gt;'.implode('&lt;/li&gt;&lt;li&gt;',$names).'&lt;/li&gt;&lt;/ul&gt;';
}

//quick and dirty utility function assumes only files you want are in the specified directories
function traverse($url){
    $entries=array();
    $dir=scandir($url);
    foreach($dir as $entry){
        if(in_array($entry,array('.','..'))) continue;
        elseif(is_dir($url.'/'.$entry)){
            $entries=$entries+traverse($url.'/'.$entry);
        }else{
            $entries[]=$url.'/'.$entry;
        }
    }
    return $entries;
}


This is a little different than what you asked for, but I see people asking for this functionality frequently so I wanted to give a complete answer about importing files as nodes, for your specific use case the callback function can be significantly shortened to:

function db_pics_callback(){
    $url='./sites/default/files/importer';
    $files=traverse($url);
    $saved_files=db_query('SELECT filename FROM file_managed')-&gt;fetchAll(PDO::FETCH_COLUMN);
    foreach($files as $source){
        $image = file_get_contents($source);
        $fn=substr($source,strrpos($source,'/')+1);
        if(!in_array($fn,$saved_files)){
            file_save_data($image, 'public://'.$fn, FILE_EXISTS_RENAME);
        }
    }
    return 'Finished';
}


That should add all of your files to the managed files database table and allow you to view them in the "Library" tab. Good luck!