WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create an upload area (frontend) for word press users on a site. I've got a lot of types opened up through some function calls, but unable to correctly get PSD support. I'm seeing a lot of different types, and to my knowledge have tried all. I'm not sure if my hosting environment makes any difference. Am on Hostgator VPS.

Anyone successfully gotten WP to upload PSDs?

share|improve this question
    
My hosting MIME type area lists it as 'image/vnd.adobe.photoshop' ... skipping it for now. Hopefully people who make PSDs are smart enough to zip them... – GhostToast Mar 19 '12 at 20:30
up vote 6 down vote accepted

This is what I use to allow PSD upload:

add_filter('upload_mimes', 'custom_upload_mimes');

function custom_upload_mimes ( $existing_mimes = array() ) {
    $existing_mimes['psd'] = 'image/vnd.adobe.photoshop';
    return $existing_mimes;
}
share|improve this answer
    
I already have this exact code actually. Not sure why it's not working. I still get this message Sorry, this file type is not permitted for security reasons when trying to upload through WP media uploader. – GhostToast Mar 20 '12 at 14:05
    
Update. Something must have been wrong. I know I had it character for character, but must have had some invalid white-space somewhere or something... I ended up copying your line (just the $existing_mimes['psd'].... part) and it worked perfectly - finally! Been beating my head against the desk on this one. Thanks for making me try again. – GhostToast Mar 20 '12 at 14:28

A quite horrible mimetype with several values - all of which are in use:

image/vnd.adobe.photoshop

application/x-photoshop

application/photoshop

application/psd

image/psd

share|improve this answer

Photoshop also uses application/x-photoshop. I imagine it varies from version to version.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.