If you have a Filefield set up and 'permitted upload file extensions:' is set to a specific file extension such as jpg and File Sources is set to 'File attach from server directory' under 'File attach settings' if you set a 'File attach path:' when clicking the attach button the file list is populated with files of every extension type. I would like if the permitted upload file extensions was respected and only files of the specified extensions were listed.

Is this a related issue? http://drupal.org/node/1006896

Comments

quicksketch’s picture

Hm, this seems like a possibly good idea but I'm afraid it would lead to confusion when files of the "incorrect" type were uploaded into the attach directory. Say I uploaded an MP3 file into the attach directory, but only AAC files were allowed, I'd be puzzled as to why my file wasn't showing up in the list. As it is now, the MP3 file shows up in the list anyway, and then when you attempt to attach the file, you get an appropriate error telling you what the problem is. I think for the sake of avoiding this confusion, the current behavior will probably stay.

quicksketch’s picture

Status: Active » Closed (works as designed)
charos’s picture

The only problem is that once the file is attached, if Drupal for any reason does not accept to save the node, the file will be either moved or copied (depends from the options set in content type) without being linked to the node. Especially if you use the move option and Drupal rejects to save the node and you delete the attachment, the file is lost! So in case of permitted file extensions this can cause an issue for the non informed end user. Just my opinion of course.