Skip to main content

Questions tagged [uploads]

This include all question concerning the process of uploading file, whether from the WP Admin Pages or from a front end editor.

Filter by
Sorted by
Tagged with
105 votes
4 answers
86k views

How to Protect Uploads, if User is not Logged In?

I use WordPress for a private site where users upload files. I use the "Private WordPress" to prevent access in to the site if the user is not logged in. I would like to do the same to the files ...
chifliiiii's user avatar
  • 2,852
67 votes
2 answers
114k views

How can I add an image upload field directly to a custom write panel?

I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
Will's user avatar
  • 893
33 votes
3 answers
10k views

Plupload Intergration in a meta-box?

I know that plupload is going to be the new upload engine for WordPress 3.3 but I was wondering if there is any documentation yet on how it integrates with WordPress. My specifically how to collect ...
Manny Fleurmond's user avatar
30 votes
6 answers
207k views

How to Fix HTTP Error When Uploading Images?

I am using WordPress 3.4.1 on Ubuntu 12.04 using Apache and PHP 5.3.X When I login to the dashboard and add a new post. Then try uploading an image to set as a featured image, I get a red box with a ...
Michael Ecklund's user avatar
25 votes
4 answers
4k views

Trigger refresh for new media manager in 3.5

I'm trying to figure out how it's possible to 'refresh' the media library in the new media dialogue in 3.5. I'm adding images from an external image library to the WordPress library (via a tab/iFrame ...
Richard Sweeney's user avatar
24 votes
4 answers
67k views

Image Upload from URL

I really like the way SE uploads an image from a URL (I'm sure many do!). I've been searching, but can't find, is there a plugin or a method similar to this available for WordPress? I know an image ...
Travis Pflanz's user avatar
24 votes
3 answers
121k views

Media files exist in upload folder but not showing up

In my wordpress, I tried to upload my images by media uploader but it says "couldn't create directory wp-content/uploads/2016/09". Then I create the folders correctly. And now when I tried to upload ...
Allen Titan's user avatar
23 votes
1 answer
5k views

Physical organization of wordpress media library (Real Media Library plugin)

Introduction. In the above screenshot you can see a folder structure built with premium plugin Real Media Library. Now I want to create an extension plugin which can organize the folder structure ...
Matthias Günter's user avatar
22 votes
7 answers
89k 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 ...
jkupczak's user avatar
  • 1,056
22 votes
1 answer
79k views

wp_upload_dir how to get just the directory name .

I imagine that this would be a breeze for some - but I'm having difficulty getting just the upload's directory name - not the full path - I've gotten this far: $uploads = wp_upload_dir(); $...
orionrush's user avatar
  • 910
22 votes
11 answers
28k views

How to generate thumbnails when needed only?

I have 1000 images. How can i make wordpress to generate thumb only when needed. For example home slider will only use 10 images i dont want the other 1000 images have that thumbnail generated as its ...
chifliiiii's user avatar
  • 2,852
22 votes
3 answers
7k views

How to add new tab to media upload manager with custom set of images?

I would like to add new tab to upload manager and inside list images from theme_folder/images/patterns I tried something like this to add a tab but it does not work for me since it is adding tabs ...
Benn's user avatar
  • 1,043
21 votes
6 answers
26k views

No Thumbnails Generated

I setup WordPress on my own server and it's up and running...one thing that I have noticed is that WordPress doesn't generate any images I upload. Usually when I upload an image through WordPress it ...
Josh Rodgers's user avatar
  • 1,173
21 votes
1 answer
8k views

Limit image upload to one and disable audio, video and other document file types to upload

Somebody knows some trick in Add new Post to: Disable the upload of audio, video and other filetypes. Only accept the upload of an image (jpg, png, gif). Limit the upload of each Post to only One ...
José Pablo Orozco Marín's user avatar
21 votes
2 answers
62k views

Add "upload media" button in meta box field

I have a custom post which has a meta tag that needs to be using a file upload (for video files). I am wondering, what is the correct way of adding an "Upload" button that points to the WordPress ...
SpyrosP's user avatar
  • 515
19 votes
1 answer
2k views

Extend Media Library

The Media Library in WordPress has "Insert from URL" link to the left. It accepts image URLs. It's not said anywhere but if you paste YouTube URL or <iframe> code then it will insert ...
Tom's user avatar
  • 191
18 votes
2 answers
27k views

How to Require a Minimum Image Dimension for Uploading?

I need a way to restrict authors from uploading images bellow specific dimensions. Say I only want to allow uploading images that are at least 400px x 400px. If the image size is smaller, the author ...
boruchsiper's user avatar
18 votes
6 answers
23k views

Add a Meta Box for uploading a SECOND Featured Image?

I'd like to add a meta box to my posts and page editor that will allow me to upload an image and use it as sort of a SECOND featured image. The idea is that my client will be able to upload an image ...
jkupczak's user avatar
  • 1,056
18 votes
5 answers
17k views

How to upload files straight to S3 without using local storage? [closed]

I'm looking for a WordPress plugin that would allow me to upload files straight to We are a development shop that actively co-creates CMS websites with clients. This means that we are often ...
tarasm's user avatar
  • 181
17 votes
3 answers
7k views

How Can I Add the "Insert From URL" Tab to a Custom 3.5 Media Uploader?

I've inserted a WP 3.5 media uploader into a widget by running this JavaScript when a button is clicked on: var frame = wp.media( { title : 'Widget Uploader', multiple : false, ...
Ian Dunn's user avatar
  • 4,837
17 votes
2 answers
8k views

How does WP media uploader create the 3 different sized images, and how can I duplicate it

I have finally!! got this thing I've tried about 12 times to make and 12 different ways, but finally got it to work,... sort of. I made a custom metabox for uploading and attaching images to posts, ...
jaredwilli's user avatar
16 votes
5 answers
46k views

Upload Multiple Files With media_handle_upload

I have a WordPress form plugin and I use media_handle_upload to upload the files and get there ids directly and attached its ids to the post as a meta date, I used the following to did that: The HTML ...
Engr.MTH's user avatar
  • 263
16 votes
3 answers
35k views

How to set featured image to custom post from outside programmatically

I am trying to fetch and insert images outside the wordpress environment to a custom post via PHP. How to move/upload that image to wordpress upload directory year date folder format just like ...
Faisal Shehzad's user avatar
16 votes
2 answers
3k views

How to make “Upload files”selected by default in Insert Media?

I am frustrated having to click on the "Upload Files" constantly instead of the first choice being Upload Files in posts editor....How can i make “Upload files” selected by default instead of "Media ...
Ghinnersmee's user avatar
16 votes
5 answers
19k views

Using Wordpress 3.5 Media Uploader in meta box?

Is this possible to do? I love how the new uploader works. I'm guessing it has to do with a jQuery call like the other way did. EDIT This is the code I am currently using jQuery(document).ready(...
souporserious's user avatar
15 votes
2 answers
23k views

WordPress 3.5: Setting custom "full URL path to files" in the Media Library?

As the recent changes in WordPress 3.5 removed the "full URL path to files" option from media library I am wondering how to set this option to a custom path now? I need to set my "full URL path to ...
faxxim's user avatar
  • 185
15 votes
2 answers
11k views

Change upload directory for PDF files

I would like to change the upload directory for PDF files only, not for other files. For example, the PDF files would be uploaded to wp-content/uploads/pdf but other files would remain in wp-content/...
Sinklar's user avatar
  • 191
14 votes
8 answers
14k views

Get $image_id after uploading with media_sideload_image()

I want to upload an image and set it as a featured image in a post. What i tried was this: $image_id = media_sideload_image($image_url, $post_id, $post_id); update_post_meta($post_id, '_thumbnail_id',...
Xavin's user avatar
  • 141
14 votes
4 answers
17k views

Allowing WebP uploads?

I've tried both of these, but I'm still getting the error message: "Sorry, this file type is not permitted for security reasons." // add support for webp mime types function webp_upload_mimes( $...
Best Dev Tutorials's user avatar
14 votes
4 answers
8k views

Load minimum WordPress environment

I made my own upload service for my website that is separate from WP, but uses WP to provide low level db functions and user verification. To do that, I include wp-load.php in my main script (...
MechEngineer's user avatar
14 votes
4 answers
25k views

Upload images to remote server

I am using Wordpress media uploader to upload images and I was wondering if there is a way to make it upload to my remote server instead of my local server? Example: My wordpress blog is hosted on ...
Ruriko's user avatar
  • 543
14 votes
1 answer
18k views

simple solution for restricting access to (some) uploads/downloads

Initial Situation For a site I'm setting up I was looking into the whole field of securing uploads/downloads and restricting access to them based on user roles/capabilities. Of course I have read ...
Nicolai Grossherr's user avatar
14 votes
3 answers
3k views

Specific upload folder for PDFs in custom Post type in WP multisite

I need to filter uploads to a specific folder for a custom-post type called "document" only for PDFs. So far, I have: function custom_upload_directory( $args ) { $base_directory = '/home/xxx/...
Gerald's user avatar
  • 141
13 votes
2 answers
28k views

"Add Media" button in custom plugin

I'm writing a custom plugin and i would like to add the "Add Media" button. I just need to upload media, not to retrieve any content/data from the uploaded file. How can I add this button? Thanks
Pepozzo's user avatar
  • 367
12 votes
2 answers
49k views

Submit post and upload image from front-end

I am trying to do something similar to the above question. I am trying to make users post and upload images from front-end. I have already done the post form and its working. I just followed and ...
Govnah Antwi-Boasiako's user avatar
12 votes
1 answer
9k views

what happens to existing media files when I switch to year/month directory structure format?

A site has thousands of images in the uploads folder. ISP has threatened to shut it down because it is about to exceed server limits for the max number of files in one directory. I looked at the ...
Tapefreak's user avatar
  • 356
12 votes
1 answer
3k views

How to disable generation of default image sizes for some custom post types?

I used custom post type, where 'thumbnail', 'medium' and 'large' sized not required. I need to disable this sizes and create function or plugin, where i can set, which image size is required for each ...
Bohdan Hdal's user avatar
12 votes
1 answer
1k views

Reject upload of wrong-sized images using the Media Uploader

I'm working on a super-strict setting for adding images to Custom Fields in the Post Edit screen. My optimal scenario would be to add a a Custom Error message when the user tries to upload an image of ...
moraleida's user avatar
  • 2,245
11 votes
5 answers
5k views

Each custom image size in custom upload directory?

I want to upload my custom image sizes in custom folders. The folder should have the name of the selected width. For example: If I add these custom sizes... add_image_size('custom-1', 300, 9999); ...
Philipp Kühn's user avatar
11 votes
4 answers
10k views

How to add a custom field to the media screen (image/gallery)?

I’m trying to add a custom field to image and gallery edit screen. I’m aware there are similar questions here, although answers either don’t work with the current version or they add field only to ...
Runnick's user avatar
  • 1,009
11 votes
2 answers
670 views

Wordpress Media Uploader events

I want to capture the click event on the "Save all changes" button? Is there any callback method like there is when you click (window.send_to_editor) the "Insert into Post" button
vlatkorun's user avatar
  • 121
11 votes
2 answers
2k 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 $blog_ID ...
David's user avatar
  • 3,275
10 votes
1 answer
18k views

Multisite stuck at 1MB for max file size

I have a Wordpress Multisite install on our FreeBSD development server. It seems to be stuck at 1MB. I have the following settings in php.ini upload_max_filesize = 100M post_max_size = 100M ...
Adam's user avatar
  • 203
10 votes
12 answers
26k views

How to delete resized (cropped) image uploads and prevent future resizing?

I want to delete all the resized images while leaving the original image. I have more than 20 GB of unused data taking up room on the server. For example: first-image-name.jpg first-image-name-72x72....
Mohamed Gamal's user avatar
10 votes
3 answers
24k views

Allow all file types for upload

I'm using Wordpress 3.4.2 for a private blog, i.e. one on which only I can post. Now, Wordpress prevents me from uploading certain file types (like C# source files). As far as I understand it, there's ...
Sebastian Krysmanski's user avatar
10 votes
4 answers
13k views

Download an image from a webpage to the default uploads folder

I am writing a custom theme/plugin in which I need to download images programatically from certain webpages to the upload folder and then insert them as part of the post. So, I was able to find the ...
Greeso's user avatar
  • 2,176
10 votes
1 answer
12k views

How to show all available images in WP's media library when using the Polylang plugin?

It seems that depending on which default language I've set Polylang to, all my uploaded images are isolated so that I can only pick them when I'm editing posts in the default language. I have a lot ...
chamberlainpi's user avatar
10 votes
6 answers
18k views

Checking if a file is already in the Media Library

I'm creating custom files in a plugin and adding them to the Media Library using the code provided in the Wordpress Codex for wp_insert_attachment. However, my plugin occasionally overwrites those ...
Dawson Goodell's user avatar
10 votes
1 answer
8k views

how to upload and allow downloads of .mobi and .epub formats

I have downloadable products for sale. I have created custom meta boxes to hold the file data I need, it allows me to upload fine to the custom meta the .doc and the .pdf files... However when I ...
Michael Stott's user avatar
10 votes
5 answers
27k views

How to restrict access to uploaded files?

I have a restricted area on a website that can only be accessed by logged in users. For that I created a page template with a 'current_user_can()' condition. My problem is that the documents attached ...
mike23's user avatar
  • 5,981

1
2 3 4 5
41