Questions tagged [upload-dir]

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

0
votes
0answers
14 views

Only allow user to download files from wp-content/uploads/ subdirectory that matches their user ID

I have this function which puts files in a /uploads/ subdirectory based on their user ID (for example, user with ID 23 uploads image.jpeg, it ends up here: /wp-content/uploads/23/image.jpeg ) and it ...
0
votes
0answers
10 views

Images returning in uploads folder

I spent hours cleaning up old thumbnails from the wp-uploads folder but I saw they all reappeared again. What could be causing this?
0
votes
0answers
17 views

Upload image in the library doesn't show up and return 403 forbidden

When I try to upload image directly in Dashboard->Media->Add new, the image is uploaded in the upload folder but is not visible in the Media->Library and on the console I see 403 Forbidden when ...
0
votes
0answers
24 views

Customizer: Upload and unzip zip file in specific folder

I'm trying to upload a zip file in the Customizer that will unzip itself and contents be placed in a specific folder. So far, I have the following control in the Customizer: $wp_customize->...
0
votes
1answer
27 views

Security: AWS (shared hosting) claims template file malicious

Recently, our hosting platform (AWS) notified us of a malicious template file: /wp-content/uploads/tcb_lp_templates/templates/tcb2-bright-content-page.tpl On closer closer inspection, there are quite ...
0
votes
0answers
15 views

WordPress upload folder stuck in 2017

Whenever I upload items to WordPress via the Media Library it is saved in wp-contents/uploads/2017/12. I tried disabling the year based upload setting and reenabling it but this didn't work. Is this ...
0
votes
0answers
10 views

How does uploading work in Wordpress?

I have installed Wordpress on a Fedora box with php, php-mysqlnd, mariadb-server and httpd. Copying pictures from the clipboard to the post editor worked. Uploading pictures did not. I added writing ...
0
votes
1answer
20 views

Save uploads directly in the uploads folder (on a multisite)

on my current page I want my uploads to be saved directly in the uploaded folder. So their links should be something like https://example.com/wp-content/uploads/myimage.jpg instead of https://example....
0
votes
1answer
28 views

What functions of WP_Filesystem allow me to create a file with code-generated contents in a directory?

I'm generating a very useful .dat file, but I read that file_put_contents if frowned upon and that WP_Filesystem should be used instead. I see no methods to take dynamic input and create a file and ...
0
votes
0answers
73 views

Remove multisite part from wordpress multisite upload directory

For multisite, there is shared (can be accessed from all sites) users and usermeta table, options table. So is there any shared upload directory? if not, is there a way to reliably remove multisite ...
1
vote
1answer
152 views

Extra “uploads” added in path

Although this is related to Advanced Custom Fields, this function uses all native WP features, so I think this is appropriate to ask here. Where is the extra "/uploads/" in path is coming from here? ...
0
votes
0answers
53 views

Overriding Generated Attachment Post URL

For a plugin I am developing I need image uploads from a Custom Post Type to go to ./wp-content/uploads/clients instead of ./wp-content/uploads/{YYYY}/{MM}. I managed to solve this with the following ...
0
votes
1answer
248 views

Soflyy WP All Import Custom File Download Issue

I need to send a user id to a remote server to download an XML file. I accomplish this with the snippet below: function custom_file_download($url, $type = 'xml'){ $ch = curl_init(); $...
0
votes
1answer
535 views

WP in subfolder hidden by htaccess, but media links show the subfolder

The WordPress install is in /public_html/example. In the .htaccess file in public_html I have this code: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^...
0
votes
0answers
92 views

Serving cache from multiple domain names

I'm using W3 total cache for caching and I've many js files with sizes larger than 100KB in the cache folder. My idea is to serve cache folder from different subdomains (All files are hosted in the ...
0
votes
0answers
29 views

Uploads from site on Server A uploaded on Server B (Like sort of CDN)

Short overview of the situation: On server A there's an site. Server B is used for files. I want that uploads made on server A (running one wordpress site) are uploaded on server B. I've changed the ...
0
votes
0answers
20 views

Uploads folder only showing files up to the letter “P”

I have recently migrated a website and for the uploads folder I just downloaded the whole thing via FTP. In the new website I am missing a few images. I noticed it's only the images that start after ...
0
votes
1answer
497 views

Change wordpress default upload path to another domain

I have a domain, for example tarikhema.org. I want to change WordPress default upload patch folder to another domain for example dtours.net. How can I do this? My default folder is tarikhema.org/...
0
votes
0answers
15 views

Downloadable content file structure

I have a bunch of files that will be used as downloadable content. Do I have to upload it as media or can I just upload to a folder through FTP? If yes, which folder?
0
votes
4answers
4k views

Media Library is not loading on grid view in admin panel

Media Library is not loading on grid view and also featured image not select any image from post and page . The progress circle keeps spinning. Due to this issue, I am not able to add any image in the ...
8
votes
1answer
746 views

Is it possible to reorganize the WordPress uploads directory?

I have a WordPress site where all uploads have been uploaded to /wp-content/uploads/*. Now that there are thousands of images, there is a performance hit, and I have been assigned to help remedy it. ...
0
votes
1answer
778 views

wp_upload_bits() is not giving the file path right in localhost

I'm trying to upload files into a separate directory inside the uploads/, and I succeed using wp_upload_bits(). I's happy with everything and I thought thing was done. But when I's trying to delete ...
0
votes
1answer
25 views

Location of image metadata on my server

To clean up my media library, I deleted some unused pictures directly out of my uploads folder. Now, whenever I go to the media library the file names are still there but the thumbnails have been ...
0
votes
1answer
418 views

How to create new folder in wp-content root same like upload folder?

My query is how to create new folder wp-content/any-folder-name using code when the plugin is activated.
1
vote
0answers
64 views

How to add upload video option in wordpress for user?

I have a website developed on WordPress.The website is basically job portal. Here in my website two types of user candidate and employer. In my website there is one signup form for both candidate and ...
3
votes
1answer
2k views

Hook filter to change wp_upload_dir() path in multisite

The upload directory and URL paths are stored in the options database. You can change them using update_option(): update_option( 'upload_path', ABSPATH . '/path/to/uploads' ); update_option( '...
0
votes
2answers
38 views

Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?

I am trying to configure a WordPress site using a server cluster and independent file systems. The problem is keeping the wp_content/uploads folder synchronized across all the server instances. My ...
0
votes
0answers
282 views

Uploading a file results in attachment post, but file is missing

I'm setting up a clone of a multisite network to act as a staging environment. Everything is rendering fine, I can log in to the admin, so far so good. When I try to upload a media item, async-upload....
0
votes
2answers
57 views

How to load file only in single post page through function.php?

I want to include a file only in single post page. I've following code but not working; if (is_single()){ require_once(dirname(__FILE__) . '/inc/lazy-load.php'); } I mean i just want to load lazy-...
1
vote
2answers
612 views

Disable to create folders for every years and months in uploads folder

How can I disable to create folders for every years and months in uploads folder? I mean there is a lot of folder under "wp-content/uploads", and the majority of them are empty. Why create WP these ...
6
votes
2answers
920 views

Change Media Uploader default directory

I am using WordPress Media Library in my plugin in the backend. How to change the upload path for it dynamically? Can it be done during the enqueue, or when creating it in JavaScript? I am using ...
1
vote
0answers
426 views

NGINX rewrite rules for multisite

I have a WordPress 4.6 network running on an Ubuntu 16.04 server with NGINX. I have one main site and then I migrated a single site installation to a subsite under that main site. I made all the DB ...
2
votes
1answer
1k views

Rename image during upload using date and time stamp?

I am trying to rename images during upload to avoid problems with image file names containig special characters and file names with non-latin characters. I found this function to rename images in ...
-2
votes
1answer
706 views

make default upload folder year/month/day wordpress without plugin [duplicate]

is there any way to change in code and make it when you click(enable) “Organize my uploads into month- and year-based folders. ” it to be default year/month/day ……… without any plugin.. Can anyone ...
0
votes
1answer
460 views

Wordpress Multisite subdomains and sharing the same upload folder

Hello, We wonder if you can help resolve two doubts about Wordpress structure. We are developing a multisite in 3 languages and would like to know about these 2 things: 1. Is it possible to develop ...
2
votes
2answers
10k views

How to upload image from front end and save in media library?

I am working on a plugin .I want to upload image from front end i.e by input type="file".I did lot of google for it but could not upload image .Here is my code for uploading image <form method="...
4
votes
1answer
4k views

How to upload an image in the plugin's options page

My code is here.The other options working perfectly so how i can register the image and save the link in database and image in wp library. function register_team_show_case_setting() { //register ...
0
votes
2answers
25 views

How to get images to show in Media when saved Via PHP

I saved a bunch pictures ( 2,000+ ) in a PHP script. I can see the list of files with adequate permissions for apache to view them in my /wp-content/2016/05 directory but They aren't showing up in my ...
0
votes
1answer
511 views

How to adapt upload_dir to save files outside of WP uploads folder

We have a CPT which is used to manage various assets including image, pdf, CAD and other files. Our client would like to keep these asset files seperate from their other media files and does NOT want ...
1
vote
1answer
632 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 ...
3
votes
2answers
17k 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 wp-include ...
1
vote
1answer
287 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 exists ...
0
votes
1answer
23 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 = esc_html($_POST['title_image'])...
0
votes
1answer
5k 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
69 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 ...
1
vote
2answers
2k 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
49 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 possible)....
1
vote
1answer
3k 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 dynamically....
7
votes
3answers
626 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 ...
5
votes
2answers
292 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. ...