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.

714 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
2k views

How to add image uploader to a custom widget?

I'v built a custom widget that will show some sport scores. Scores are added trough custom post. When i open new custom post(scores) i enter their team names, score, scores. Now i want to add an ...
Max's user avatar
  • 129
4 votes
0 answers
107 views

Saving WordPress generated thumbnails in a subdirectory

I.e. an uploaded image image.jpg is stored in wp-content/uploads/2016. WordPress will generate thumbnails named image-150x150.jpg, image-300x300.jpg, and image-1024x1024.jpg in the same directory. Is ...
kamath's user avatar
  • 41
3 votes
1 answer
354 views

How do I display a PDF thumbnail as a link to the PDF without uploading the image

When I found a couple of years ago that WordPress will create thumbnails of uploaded PDFs, I was so happy, thinking I wouldn't have to make and upload separate PDF cover images to have a thumbnail ...
bkepl's user avatar
  • 131
3 votes
1 answer
956 views

Using the <MediaUpload /> component outside the editor. select('core') is null

I am using the WordPress components in the admin panel of my plugin and trying to make an image upload button. The button works fine and allows me to select an image, but when I select an image, I get ...
Rafaucau's user avatar
  • 173
3 votes
1 answer
1k views

Create custom tab in WordPress 5 media upload

Can someone help me create custom tab in WordPress media library. With WordPress version 4 i used to media_upload_tabs function to build that nice work. But now, in WordPress version 5 the function is ...
Mr.hiepdz's user avatar
3 votes
0 answers
625 views

Retroactively place uploaded media into -month, -year based folders?

I am working on a client's site. It has about 8GB of images in the uploads folder. Unfortunately, from day one, years ago, uploaded media files were not set to be organized into month-, year- based ...
Mauricio's user avatar
3 votes
1 answer
898 views

Image upload via FTP to wordpress media library

Is there any permanant way to upload images via FTP to WordPress media library other than the available plugins which don't really work well most of the time? I would really appreciate if anyone ...
John D's user avatar
  • 41
3 votes
1 answer
155 views

How to upload images from my directory into my wordpress?

I'm doing a paste the link onto input and then uses PHP(imagecrop) to crop and store the image onto server directory. $imagesrc = $_GET['img']; $img = file_get_contents($imagesrc); $im = ...
ExistNot's user avatar
3 votes
0 answers
170 views

How to add multiple mime with same suffix in wordpress?

I'm having problem adding archive files to wordpress. The original $allowed_mime_type is using application/zip, while there are other mime type of .zip like application/x-zip-compressed, application/...
Jisper Liu's user avatar
3 votes
0 answers
590 views

Media upload via backend doen't work after moving site

I have copied my site to a subdirectory for test purposes, everything works fine now. The only problem I have seen so far is the Media upload. When I try to upload a file I get a: Unable to create ...
Vika's user avatar
  • 31
3 votes
1 answer
1k views

How to disable drag-and-drop upload function in Media Library?

Does any one knows a valid/standard way to disable drag and upload when accessing the media library in the admin area? In order to make this sense to you, I'm building a multisite and user of sub-site ...
Dbx's user avatar
  • 31
3 votes
3 answers
2k views

Retrieving JSON data in ajax request from media uploader

I'm having some problems getting my JSON data that's being passed via an ajax request. I'm trying to implement the media uploader into a plugins settings page. I've got it functioning properly using ...
gregz's user avatar
  • 31
3 votes
0 answers
2k views

Changing image URLs in media library

On a default wordpress install, the media library is located at: /wp-admin/upload.php. I am trying to update the image URL to point to my CDN, not my local server. This filter add_filter('...
David Register's user avatar
3 votes
1 answer
1k 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 ...
Dima's user avatar
  • 221
3 votes
1 answer
862 views

HTTP Error when uploading images

I am getting an 'HTTP Error' when uploading images to posts. What could be the reason for this? It doesn't happen all the time, sometimes I get the error, try again, and the file uploads. Actually the ...
urok93's user avatar
  • 4,034
2 votes
0 answers
17 views

I can't see all images in my media library - How Can I reset the index of that library?

When I load my media library (either through the media tab on the left or editing posts/pages and adding images in that interface) it shows that I have 1206 images in my site. However when I click ...
pressword's user avatar
  • 360
2 votes
1 answer
69 views

WordPress Permissions Issue for Media Library / uploading

I've got some issues with file permissions which I'm trying to resolve... I have two sites and they both have the same permissions as far as I can tell but for some reason one site can upload files / ...
Ryflex's user avatar
  • 73
2 votes
0 answers
104 views

Wordpress auto generates small medium and large of an image on upload, how can we guess their links?

WordPress out of the box has an integrated image sizes system, which creates files ( thumbnail, S, M, L) but in the media library, it only shows one original file size link. Let's say, I upload a file ...
techshqq's user avatar
2 votes
0 answers
125 views

Regenerate thumbnails unexpected resolution (96 x 96)

I'm using WP CLI wp media regenerate to resize my thumbnails. I've noticed something a bit weird. The original image I upload is a JPEG with a resolution (DPI) of 72. The images that are generated ...
Sam's user avatar
  • 2,136
2 votes
0 answers
674 views

Update image via WP REST API

So I wonder if its possible to update images in the media library via the REST AP? Ive seen a github issue back in 2016 where its mentioned this its not supported in the REST API. Is this still the ...
H. berg's user avatar
  • 121
2 votes
0 answers
24 views

Is 700,00 jpgs too many for a WordPress site.?

I am helping a customer with a website( uses WordPress ) that is very slow to load and sometimes times out or does not respond. I notice they have 692,264 jpgs in /home/xxxx/public_html/wp-content/...
physicsgeekn's user avatar
2 votes
0 answers
529 views

REST API: upload media with advanced custom fields (ACF)

Aim I am trying to upload media via the REST API. I have successfully got it working, except for with the ACF data. Problem The media uploads successfully, but the acf fields are blank. Code const ...
Darcy's user avatar
  • 121
2 votes
0 answers
634 views

How to change upload directory based on frontend form input name or ID?

I created a frontend form using a plugin which allows logged in users to create draft posts. There are 3 file upload areas. I need 1 of them to use the default public WP media upload folder as usual. ...
user197754's user avatar
2 votes
0 answers
155 views

How to host different file formats/types for a media attachment without creating multiple attachments?

For a better browser compatibility we often have to maintain multiple format of a media. For example: Image - JPG & WebP Image animated - GIF & WebP Image transparent - PNG & WebP Video - ...
Sisir's user avatar
  • 7,772
2 votes
0 answers
277 views

wp_generate_attachment_metadata generates 503 Service Unavailable or 500 timeout errors

I've been struggling for a week with this... I was trying to upload an image with media_handle_upload but it never worked (it always timed out), so I decided to break it down to see where it failed ...
marcnyc's user avatar
  • 121
2 votes
1 answer
438 views

Syncing Avatars across multisite

There's gotta be a way. I have tried a bunch of different multisite sync plugins and they sync users and roles just fine (even paid for plugins to do so)....but avatars don't sync. My registration ...
CA Legendre's user avatar
2 votes
0 answers
45 views

Media Library does not show the uploaded image

I am using a custom form to upload image and trying to move the file in the Media Library. The wp_insert_attachment() is working fine because I get the attachment id; however I don't see the image ...
Khairul Alam's user avatar
2 votes
0 answers
46 views

How to re-arrange media uploaded using : media_handle_upload() as per year / month

I have been facing this issue that all the new media files are getting uploaded to single folder which was auto-generated during initial site development. Now since all new images are getting uploaded ...
Siddhesh Shirodkar's user avatar
2 votes
0 answers
2k views

move_uploaded_file() not working on wordpress front end

I have working code that uploads an image from the front end and sets it as a featured image and custom field photo for a custom post type but I am unable to figure out how to set the upload path. ...
theone581's user avatar
2 votes
1 answer
499 views

ACF attachment custom field in rest response

I created an extra select option ACF field for media uploader and I would like to retrieve the associated values in Gutenberg MediaUploader onSelect. Is there a workaround for this case?
fefe's user avatar
  • 874
2 votes
1 answer
3k views

Admin page: form with enctype="multipart/form-data" does not transfer its data

I'm googeling for hours now but can't find anything to my problem: I'm building a plugin and want to embed a file input in its admin page. For this reason I'm giving the form-element the attribute ...
Robert's user avatar
  • 321
2 votes
0 answers
612 views

Media library not loading after switching the main site of multisite

I switched the subsite and main site of a multisite. Now, the images are not loading in the media library and posts of the main site. However other subsites are working fine. The images of the new ...
daniel's user avatar
  • 23
2 votes
0 answers
52 views

How to stop unlink images when remove a site or user

What's the best way to prevent images deleting?. I have a central cdn site to share images to several sites on wordpress multisite, and by mistake, I have remove a user from the network and all my ...
TorryVic's user avatar
  • 153
2 votes
0 answers
430 views

Multisite media library uploads broken images

I am having an issue with one of my sub-sites media library. All it uploads are broken images. It loads fine locally but for some reason it gives me the error "Failed to load resource: the server ...
Michael Stokes's user avatar
2 votes
0 answers
222 views

Use WordPress's Media Uploader/ Manager in non WordPress php application

I need a image upload and browse, resize, crop functionalities. Since it is already built available in wp. I need some idea how can i use it my custom php application Laravel. Adding the media ...
Abel Jojo's user avatar
  • 121
2 votes
0 answers
124 views

How to rename image at uploading on specific plugin or post-type in WordPress

I am working on a plugin. In plugin, there is a custom media uploader. All images upload successfully. Then I want that when I upload images its renamed, so i get this code and write it in my plugin ...
deemi-D-nadeem's user avatar
2 votes
1 answer
485 views

WP Media uploader loading only once in options page

A weird issue happening with me which I am unable to fix. In my theme options page, I added options to upload images one for logo and another for backgroud image. Here is my HTML <table class="...
Ayanize's user avatar
  • 247
2 votes
1 answer
356 views

wp_upload_bits Upload Specific Sizes Only

For images uploaded using this code, I want to only upload the full-size image and the thumbnail (whereas for images uploaded through site, I want all sizes). However, I can't figure out how to make ...
Pamela's user avatar
  • 161
2 votes
0 answers
676 views

Sharing a common set of image files for media library, across all sites within multisite

In mutisite, the uploads directory structure looks like this: /wp-content/uploads/sites/1/ /2/ /3/ Each number is the id of the site within the ...
C C's user avatar
  • 1,948
2 votes
1 answer
222 views

Can't seem to upload a file to a custom directory

I am trying to do something extremely simple. I just want to save a file, in a custom wordpress upload directory inside of the media library. But it just won't work. I've tried the solution here, ...
phpwebdev's user avatar
2 votes
0 answers
2k views

AJAX image upload with a upload progress bar using media_handle_upload

I currently have post image upload for the featured image from front-end form. <input type="file" name="wh_image_upload" id="wh_image_upload" multiple="false" /> and using media_handle_upload ...
Ohsik's user avatar
  • 407
2 votes
2 answers
5k views

How To install AWS SDK for PHP in wordpress?

I am going to install and use AWS SDK for PHP to facilitate uploads/list objects directly from the front-end of my WordPress instance to S3. What is the best practice to do that ? P.S: I don't want ...
armin's user avatar
  • 47
2 votes
0 answers
1k views

How to delete uploads not in media library?

How to delete uploads not in media library? I have lot of images in my uploads folder but doesn't in media library. Exist some method how this do it?
user2219071's user avatar
2 votes
1 answer
540 views

Different upload path per file type

I want to have two different paths for different files. For example, I have all .zip and image files all in the same locations. What I am wanting to the have images in one path (eg. wp-content/...
idolisedmedia's user avatar
2 votes
0 answers
188 views

wp.media add context

I have wp.media frame on my plugin to upload doc, docx file. I am filtering the uploaded file. If uploaded other than supported file, it will display this error I am filtering it at ...
user98239820's user avatar
2 votes
0 answers
68 views

Add fields to the WordPress media uploader

I am trying to add an URL field to the WordPress media uploader using following code: /** * Add an URL field to gallery attachments * * @param $form_fields array, fields to include in attachment ...
Igor Skoldin's user avatar
2 votes
1 answer
80 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 ...
user2093301's user avatar
2 votes
0 answers
416 views

Refreshing collections in the admin media manager

I know this question is very similar to this previously asked question; however, I was wondering if there was a more up-to-date/official way to refresh content programmatically in the WordPress admin ...
doubleswirve's user avatar
2 votes
1 answer
1k views

How to get profile user id when uploading image via media uploader on profile page

I have a PlugIn which lets a user upload an image to a user profile in the backend. Now I want to access the user id in the uploader to change the filename of the uploaded image. On the user profile ...
benutzerfreund's user avatar
2 votes
0 answers
2k views

How to resize image on client-side before upload?

I've been using Plupload to resize images on the client side before uploading them to the server. I've implemented a front-end form which lets the user select a file from their computer and submit it. ...
henrywright's user avatar
  • 3,077

1
2 3 4 5
15