The Wordpress upload directory. [Read more about `wp_upload_dir()` here](http://codex.wordpress.org/Function_Reference/wp_upload_dir).

learn more… | top users | synonyms

1
vote
1answer
705 views

Organizing uploaded media with wp_insert_post() and wp_handle_upload according to time parameter

I'm retroactively creating a post with wp_insert_post() and attaching a featuring image to it. I need the image to go into the folder that corresponds to the post's publishing date. I'm using time ...
1
vote
1answer
53 views

Get User's Facebook Photos as Wordpress Upload

I am new and a bit of troublesome on how Wordpress work as I have plan to use it as CMS for my commercial website. I have been figuring out on how to make an image that I have retrieved from user's ...
0
votes
1answer
40 views

Change WordPress upload path and URL

On a fresh install, I want to move the upload folder to a subdomain (supposed to speed up download). My subdomain links to a folder called static. So I have: Home wp wp-admin wp-content ...
9
votes
2answers
559 views

Get upload URL by blog ID in multisite

The essence of the question is, I'm looking for a solution like this: $blog_upload_dir_info = wp_upload_dir( $date, $blog_ID ); $blog_upload_url = $blog_upload_dir_info[ 'baseurl' ]; Where ...
0
votes
1answer
26 views

Unable to Upload Files

So, I have Wordpress installed on a GoDaddy server, and I am getting an error saying: Unable to create directory uploads/2016/03. Is its parent directory writable by the server? The folder ...
0
votes
1answer
11 views

How to stop a post from publishing if the file upload is not a image/gif

This is the code and i want to stop the post publishing if the file is not an image Is this possible ? case "window-image": $format = 'image'; $title = ...
4
votes
2answers
2k views

Different upload directory based on post type in a theme

I have a lot of uploaded image files and image sizes. So it would be better to organize media files into folders based on post type. I have just read this tutorial, but as I can see it works with ...
0
votes
1answer
88 views

Too slow Image upload in Wordpress Media Library as image number increases

we are using Wordpress 4.4.2 and the Wordpress Media Library for media management. We have noticed that as media (images, not videos or audio) number increases, the upload process takes too long...and ...
0
votes
1answer
25 views

cant able to upload media to my wordpress blog

i am trying to upload an image for a post in my WordPress blog but it is giving error: “image.gif” has failed to upload. Unable to create directory uploads/2016/02. Is its parent directory ...
0
votes
0answers
43 views

Make Wordpress upload directory outside wordpress root with custom url

I want to change the upload directory for Wordpress from project.dev/wp-content/uploads to cdn.project.dev Where subdomain cdn has DocumentRoot: HostPath/project.dev/cdn while Wordpress is located at ...
0
votes
1answer
34 views

Renaming “Expand Details” within “Add Media”

I was wondering if it was possible that the "Expand Details" option via "Add Media" can be renamed? I couldn't find a guide online so I thought I would ask here for guidance, (that's if it's ...
1
vote
1answer
76 views

List and show uploaded pdf files dynamically

I want to show all the PDFs for a specific WordPress page. I exactly want that the PDF documents will upload from the admin panel and I want to show all the PDFs in a page in the front-end ...
5
votes
3answers
183 views

Why my uploaded picture was loaded into /uploads/2015/02 not /uploads/2016/01?

Today is 2016-01-01 in my console. date Fri Jan 1 14:24:04 CST 2016 Now I write an article attached a photo which is taken today and publish it today. I found that the URL of the photo was ...
4
votes
2answers
1k views

Organize uploads by year, month and day

As of now my uploaded files are organized by year and month. But I would like to organize them by year, month and day. I mean like this 2012/10/30/image goes here PS: There is a plugin available to ...
2
votes
1answer
3k views

wp_handle_upload() - how to upload to a custom subdirectory within uploads

wp_handle_upload() works for me, but uploads files where it wants (uploads/year/month). Question: Is there any way to tell it to upload files to a custom dir (uploads/mycustomdir)? Or is there some ...
4
votes
2answers
50 views

Custom upload directory per CPT; when removed, file not deleted

I have this code in functions.php that organize media upload according to its Custom Post Type (CPT). So all images uploaded to a "Product" CPT will be inside wp-content/uploads/product directory. ...
7
votes
1answer
633 views

Custom “Uploads” Dir: “Edit Image” in Media Library broken

Directory Structure I have customized my (local) install (dev box). The current directory structure is: ./root |- wp (WordPress Core root) \ |- wp-config.php |- wp-content (Content and ...
0
votes
0answers
12 views

How to limit the access of each user just to his own uploaded files Amazon S3?

In my Wordpress website Users can upload video files directly to the Amazon S3 bucket from the front-end, how to limit the access of each user just to his own uploaded files and not the other users ...
0
votes
1answer
31 views

How programatically cause uploads folder to be created?

My plugin uses the uploads folder to store some files for configuration (as that folder is writable on all installs and I've had issues with Wordpress deleting files elsewhere on some installations). ...
0
votes
0answers
24 views

Custom Upload Directory for Custom Post Types

I have almost 64 different custom post type. Now I want to set custom media upload directory to them. I have 8array that contains 8custom post type each. For example: array1 = ...
0
votes
1answer
103 views

Get all images in uploads directory and list them

I'm trying to get all of the images inside a specific sub-directory within the WordPress uploads directory, and then output all of those images. $upload_dir = wp_upload_dir(); $logo_dir = ( ...
0
votes
1answer
22 views

Error while uploading photos

The photos I am trying to upload to my site are either in JPG or PNG but every time I try to upload them it says, Error try again later. Why is this happening and how can I fix it?
0
votes
0answers
62 views

Custom upload folder

I have custom post type and I would like that when admin/user uploads images (for example featured image) to this custom post type, the image would be uploaded to custom folder. As default they go ...
0
votes
0answers
174 views

403 Forbidden when accessing image in wordpress

I am getting 403 Fobidden error when trying to access directly from URL. Here is my blog page url : http://www.modestmoney.com/peer-lending-returns-still-sizzling/ Images are displaying in post ...
0
votes
1answer
135 views

Media Library doesn't allow uploads? Upload Directory

I just put up a WP 4.31 site. Most of the content was copied from a different WP site via FTP. All the stuff in wp-content: uploads, plugins,themes, etc. It all seemed to work as usual, and I've ...
0
votes
2answers
6k views

Organize media uploads in folders - I have a physical access to (my) server

I'm very new to Wordpress. With the help of my friend I installed Wordpress on my server and finally we have our web online. However, I would like to upload some content in media library but I need to ...
6
votes
3answers
433 views

Standard location for plugin to save/cache files?

Are there official guidelines on where a plugin should cache files? If not, is there a best-practice out there that I can follow? For example, a plugin grabs content from a back-end system ...
1
vote
1answer
6k views

Proper way to change the path of uploads folder for existing WordPress site

Until now I have used default WordPress directory structure, however since I started using GIT, I plan to setup WordPress as a submodule and also change the paths of upload folder. Since the path for ...
0
votes
0answers
65 views

Custom upload directory for each file only for current plugin

I have a custom plugin to add project documents in my Wordpress site. Now these documents should be stored in their respective project folder such as: EN001/Document1.pdf EN001/Document2.pdf ...
0
votes
1answer
38 views

How to create an uploads subfolder on a multisite setup?

I have a plugin which will create a folder inside wp-content/uploads, using this code: //Generate stuff on plugin activation function sample_plugin_activate() { $upload_dir = wp_upload_dir(); ...
0
votes
2answers
104 views

New wordpress uploads are broken

I have been running a network of WordPress sites (Multisite) since version 3.8.1. I've been constantly updating plugins and core. At some point, I discovered that uploading new images yields broken ...
0
votes
0answers
36 views

change upload dir

Currently my images are like www.example.com/wp-content/uploads/2015/06/xxxxxx-yyyy-zzzz-photo-no.jpg I want this like www.example.com/wp-content/uploads/xxxxxx/xxxxxx-yyyy-zzzz-photo-no.jpg or ...
2
votes
2answers
236 views

Change upload directory on custom plugin page

I am trying to change the path to my uploads directory when on this one specific page in my custom plugin. The page is a standard php page and not any specific type of post type page. I have found ...
0
votes
1answer
2k views

Upload folder is not writable, even when permissions are correct

I recent migrated my site from Godaddy to Webfaction. On migration, I get this error: Upload folder is not writable. Export and file upload features will not be functional. Naturally, I check ...
0
votes
2answers
946 views

Separate Uploads folder on other server

Is there a way to separate wp-content/uploads on different server ? I mean if i have two servers. Serv1 and Serv2 . On Serv1 is the wordpress installation and on Serv2 stays only the uploads folder. I ...
10
votes
4answers
38k views

Can I upload media to a specific folder?

By default, media uploaded through the Wordpress dashboard goes into a folder determined by the current date. For example: /wp-content/uploads/2011/09/. Once the media is uploaded I'm not seeing any ...
5
votes
1answer
183 views

How are the year and month folders added to the uploads directory?

How are the month (and year) folders automatically added to the uploads directory? The plugin that I am writing keeps track of the folders in uploads and I want to be able to add the new folder(s) ...
1
vote
2answers
768 views

Change WordPress' media upload URL?

This isn't the usual "How do I change the media upload folder?" question. Our entire site is run through a CDN. The CDN drops POST requests with a 5-6MB file so the WordPress uploads fail. I can work ...
0
votes
2answers
459 views

Change upload_dir folder at a certain cpt but cant change back

im try something with the upload_dir filter I check the current CPT with this function function get_current_post_type() { global $post, $typenow, $current_screen; //we have a post so ...
0
votes
4answers
9k views

Missing a temporary folder despite settings in wp-config.php

When trying to upload media to my Wordpress 4.0 running on a shared Apache 2.2.14, PHP 5.3.2 host, I get the error message "Missing a temporary folder". I have no influence over the php.ini which is ...
0
votes
1answer
57 views

Customize WordPress Upload Directory

I'm trying upload certain files to the following custom director: /wp-content/uploads/audio/yyyy/mm However, the year and month directories are not being created properly. They are showing up like ...
0
votes
0answers
272 views

File path for attachments outside of wp-content/uploads

I am creating some custom post creation pages with PHP. I create a simple post and want to attach an image I already have on my server to the post without moving it into the upload directory. I am ...
1
vote
1answer
164 views

What are best practices to storing uploads in Wordpress?

We've been storing all of our images using the default /year/month/day, but I'm thinking there has to be a better way to store things because everytime that I update a image or pdf. I have to reupload ...
2
votes
1answer
52 views

Organizing media uploads

One of my clients wants to transfer his WordPress website to my server. The problem is his website doesn't use sub-folders in his upload folder, and he has more than 1,000,000 files in the root of his ...
0
votes
1answer
70 views

Impossible to index an upload folder with 10k files

I have a WP installation which has a very large uploads folder with a bit more than 10k files. At the time we unset year/month folder organization and now we have huge problems to download or backup ...
0
votes
1answer
81 views

Post Type Upload Directory - {post_type}_upload_dir filter

I'm working with modifying the upload directory depending on which post type is being uploaded to. I've ran across this question: Post type specific upload folder in 3.5 and one of the lines confused ...
1
vote
1answer
103 views

Change wp-content/uploads to uploads/%postname%/%image%

When uploading an image to a post, I want to change it so that it grabs the postname or post_id and places it in a folder like uploads/%postname%/ Is there a simple method of doing so? thanks
3
votes
2answers
2k views

Set custom upload path for custom post type only?

I have a custom post type of 'clients' and would like all images/files uploaded through the admin for these posts to go to a specific directory on my server, but everything else to stay as normal. Is ...
0
votes
1answer
341 views

Wordpress File URL Path Incorrect

I have images uploaded to a Wordpress site and they can be accessed by the following URL: http:/eatdrink.ca/content/uploads/2014/09/FoodWebSummer-main-420x194.jpg but Wordpress is giving the ...
0
votes
0answers
1k views

File(X) is not within the allowed path(s):

I installed wordpress on a windows server with Parellels. It is a shared hosting. When i upload images it gives the following warning: Warning: file_exists() [function.file-exists]: open_basedir ...