Custom Upload Path by File Type
-
Is it possible to preserve custom upload paths for media files?
I’m currently using the hook
wp_handle_upload_prefilter
to upload media with specific file types into certain directories. For example, images (e.g. jpg, png, gif, etc) are uploaded to ‘wp-content/uploads/img/’.The Amazon S3 and Cloudfront plugin removes the directories within the file’s path when uploading to S3. I noticed I can define a custom upload path within the plugin’s settings, but this isn’t what I’m really after.
I’ve include a Gist for the code that creates the directories. Any insight would be appreciated.
Plugin Version: 0.8.2
Gist: https://gist.github.com/blainerobison/552e49abec345d431dd3
- The topic ‘Custom Upload Path by File Type’ is closed to new replies.