Question: I’m stuck into something about File and Relationship and looking for help. I’m wondering if there is a way in EE2 to have something like Playa but for file relationship.

Basically, I have a bunch of images updated on a folder “my\_images” via the File Manager. I would like to get a field on a channel that could list all the files of that specific folder so admins could pick one of already stored images. The same way for instance, Playa is doing when you want to create a relation between an entry to another entry. But in that case it would be between a file and an entry.

I know there are numerous ways to handle that using channel images for instance but the thing is we already have a bunch of images stored on the folder “my\_image” uploaded via the file manager plus, we don’t really want to have an “Upload” functionality on the channel entry. Only a way to select a stored image of the folder “my\_image” that would create a relationship.

If someone knows something about it, a module or a direction to look into, it would be greatly appreciated.

Answer: 
If having the upload functionality is not a killer then you could accomplish this quite easily with SafeCracker File. Of course if you are wanting to prevent any further uploads then this won't be an option without altering the fieldtype (which wouldn't be too hard).

Update:

Editing ft.safecracker\_file.php and replacing line 77 will remove the upload option from the fieldtype.

I have commented out the line below and added a line to prevent PHP notices.

```
$vars = array(
        'data' => $data,
        'hidden' => form_hidden($this->field_name.'_hidden', $data),
        //'upload' => form_upload($form_upload),
        'upload' => '',
        'placeholder_input' => form_hidden($this->field_name, 'NULL'),
        'remove' => form_label(form_checkbox($this->field_name.'_remove', 1).' '.lang('remove_file')),
        'existing_input_name' => $this->field_name.'_existing',
        'existing_files' => $this->existing_files($this->settings['safecracker_upload_dir']),
        'settings' => $this->settings,
        'default' => FALSE,
        'thumb_src' => $thumb_src
    );

```
Why not use Assets? Has an excellent UX, and file uploading can be disabled per usergroup, and it should work with files that were already uploaded via the file manager.