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
1 vote
5 answers
3k views

How do I fix "Sorry, this file type is not permitted for security reasons"

When I try to upload any PNG file, I get the following error message: I have no plugin or anything installed, that could cause this. I even added the following line in order to fix this: define('...
1 vote
1 answer
987 views

upload_mimes not accepting CSV

Hi I am adding support for CSV uploads like so : add_filter( 'upload_mimes', function ( $mime_types ) { $mime_types['csv'] = 'text/csv'; return $mime_types; }); How every when I try to ...
1 vote
3 answers
827 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 ...
0 votes
1 answer
129 views

Wordpress Media Uploader not displaying image that has just been uploaded

I am trying to implement a custom WP Media uploader within a plugin. I want multiple images to be uploaded also. I have the following javascript to open the media uploader. The modal opens fine and ...
1 vote
2 answers
5k 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
1 answer
968 views

How to split my uploaded media into directories?

I am reading the documentation of WordPress Media Library and it seems to me that it doesn't allow me to split my uploaded media into directories. Is it true? Why this choice? How can I implement ...
0 votes
1 answer
743 views

WordPress Media manager select file button, how to prevent hiding?

In a customized mediamanager (base versione 3.5) I would like to keep displayed the "select file" button even when some files are already uploaded in the album. Is there a simple solution?
2 votes
1 answer
1k views

Adding wp_enqueue_media(); causes problem

I want to add the media uploader in the theme options page. If I add following code in the options page, the media uploader works fine there, but it creates problem in the standard posts featured ...
1 vote
2 answers
2k views

using media_sideload_image with a file from theme directory

I'm building a Wordpress site in which an admin can upload a video file from post metabox. After that post is saved and the video file is attached to the post, I used ffmpeg to get the screenshot at ...
1 vote
2 answers
2k views

What is the alternative to `<?php the_content(); ?>` when it comes to calling Media (image) files in the 'attachment.php' file?

I am in the process of putting together my own WordPress Theme. Up until now, I have been using the 'single.php' file to act as a Template for both my Blogs and Media Files. In reference to my Media ...
1 vote
1 answer
11k views

an error occurred in the upload. please try again later (Maybe File Permission Issue)

I have two user roles: admin and author. I cannot upload an image in frontend by using an author account as I receive an error message an error occurred in the upload. Please try again later. But it ...
1 vote
1 answer
1k views

Show media-frame-menu on custom Media Frame

I have a plugin I built that adds a custom media frame with the following: media_frame = wp.media.frames.media_frame = wp.media({ title: 'Select your images', button: { text: 'Use Image' }, ...
0 votes
1 answer
1k views

What folder to place Large Video files?

I'm using WordPress to upload videos. I have to use WordPress to upload the videos, because they need to remain past a password protected side of the website. I have access to the WordPress content ...
1 vote
1 answer
2k views

Uploading PDF using Media Uploader

I have been using a custom code to upload images to Wordpress using custom metaboxes. Here is the code: <script type="text/javascript"> jQuery(document).ready(function( $ ) { var ...
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 ...
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 ...
0 votes
1 answer
24 views

Get Specific Files (Only Specific Extension Type All Files in Loop ) from Media

I want to get Specific Extension Files from Media of Current Post Uploads—for Instance, .jpg or .png or .pdf, or MP4. (Get Only 1 Extension All Files From Current Post Uploads) Specific Extension ...
1 vote
2 answers
3k views

Using $_FILES variable into the same function for uploading images and files

I want start saying that I'm learning and I'm trying to understand the use of $_FILES and $file_handler which are making me crazy into this function to upload attachments from a frontend form. What ...
7 votes
6 answers
16k views

How to upload SVG in WordPress 4.9.8?

I tried uploading after installing different plugins. Even added a filter to functions.php file. function add_svg_to_upload_mimes( $upload_mimes ) { $upload_mimes['svg'] = 'image/svg+xml'; ...
0 votes
1 answer
24 views

Cannot add image (png, jpeg, etc.) but can add pdf, 403 forbidden when posting

I just encountered a bug when I am trying to post with images. When I am adding media using "Add Media" button, the image will not add and will have this error: POST https://philsa.gov.ph/...
1 vote
2 answers
4k views

Uploaded images do not show on localhost

I'm working with Wordpress 3.3.1 on a local installation. I've uploaded an image file and it doesn't show up. The base directory is a symbolic link /var/www/wordpress/ that leads to /usr/share/...
0 votes
2 answers
1k 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
5 answers
8k 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 ...
0 votes
2 answers
886 views

Using WordPress’s add_cap method to Allow Contributors to Upload Media is not Working

I would like to allow contributors to upload media by using the following code added to functions.php. But the Add Media Button still doesn't show up. // Allow Contributors to Add Media if ( ...
0 votes
3 answers
2k views

Can't upload svg files in WordPress

I am facing the following issue while uploading any SVG file and sometimes face the same issue while uploading any image. "The server cannot process the image. This can happen if the server is ...
0 votes
3 answers
2k views

OSX El Capitan local install Maximum upload file size: 2 MB But php.ini set to 64M

Brand new site. Not MU. No matter what I do, I cannot get a file uploaded that exceeds 2MB. I'm running a localhost server with WordPress 4.3.1 I've modified both relevant settings in the the site's ...
0 votes
0 answers
11 views

Simplifying 'Add Media' Modal in front-end Content Editor

I am using a front-end submission form for users to contribute posts to my platform. Users can upload text and images via the content area. However, I would like to simplify the interface by limiting ...
1 vote
2 answers
5k views

Upload file could not be moved to wp-content/uploads

I know it has been asked over and over again on the internet and i spend hours digging deeper into the web. But the no answer so far. Why we get this error when you upload a file The uploaded file ...
0 votes
2 answers
814 views

How do I update attachment urls after changing site domain

I recently moved my site from https://subdomain.example.com to https://example.com. Now all my attachments still point to https://subdomain.example.com/wp-content/uploads/2021/04/file.mp3 even though ...
1 vote
1 answer
3k views

Symbolic link for uploads in wordpress

Hi i am a new bie in wordpress. i use load balancer for my sites. So the request can be processed by any of the 4 servers. so i moved all contents from /wp-content/uploads to the centralised server /...
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 ...
0 votes
1 answer
3k views

wp_handle_upload specified file failed upload test

The code I am using is practically the same as the codex. The $u and $m return true. Just the $error gives "specified file failed upload test". Thanks for any help you can give. FORM: PHP if ($...
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 ...
0 votes
0 answers
20 views

Wordpress Playground and uploading permission issue

I've been testing the Wordpress Playground with my plugin. My plugin offers a way to upload a file to wp-content/uploads/ and it seems to work in the playground. $file_name = $file['name']; $temp_file ...
0 votes
0 answers
24 views

How to Upload a media item with alt text and description

I'm trying to upload a media file to the media library with the altText and caption for it using the media endpoint: https://developer.wordpress.org/rest-api/reference/media/#create-a-media-item ...
0 votes
1 answer
3k views

How to trigger "wp_handle_upload_prefilter" filter when uploading an image programatically?

I am sanitizing uploaded SVG files with wp_handle_upload_prefilter, example: // Example code add_filter( 'wp_handle_upload_prefilter', function($file) { if ( $file['type'] === 'image/svg+xml' ) { ...
7 votes
4 answers
18k views

Limit image resolution on upload

I'm running into a problem where a particularly huge image is causing my VPS server to reboot because of memory issues. The configuration of this is out of my hands, it's sort of like the host's ...
0 votes
1 answer
2k views

Add file upload with validation to custom form

I have a custom contact form page that I am trying to add an upload field that validates filesize and filetype. Before adding the validation everything worked. <?php /* Template ...
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 ...
0 votes
1 answer
825 views

WP default file upload hook not working if used in a plugin

WP version: 4.7.2 I'm creating a plugin and I use wp_handle_upload_prefilter & wp_handle_sideload_prefilter to filter file size and return errors. When added to the theme's functions.php, both ...
0 votes
1 answer
2k views

Many images in wp-content/uploads folder that are not in Media Library

I think my database must be out of sync, or something. I checked the wp-content/uploads folder in my Bluehost File Manager and I have many more folders and files than I see in the Media Libary. I also ...
0 votes
2 answers
2k views

wordpress ajax upload media not working

I move my wordpress website to another server that is centos7 and apache web server and everything is ok but ajax upload in media not work. it is ok when i did not use ajax but it has problem with ...
0 votes
1 answer
720 views

Can't upload format files on media library

I have an issue for uploading .ppsx format on the media library. all the powerpoint format (pptx ppt, pps) can be uploading without problem except the .ppsx format and i don't know why. when i try to ...
1 vote
1 answer
971 views

Is it possible to use media_sideload_image to upload local files?

I want to add media_sideload_image to upload a file programmatically . I've got it working when the image URL is online (e.g. http://etc...) but not when it's a local file from my hardrive or network ...
0 votes
2 answers
536 views

fails upload images in posts + wp-admin/upload.php 403 error

I have a problem with WordPress 6.1.1, I can't upload images in posts. The error message says 'The server cannot process the image. This can happen if the server is busy or does not have enough ...
0 votes
2 answers
757 views

Missing a temporary folder not fixed

I uploaded my first wordpress website on the server, but trying to add new media files, i have got the message "Missing a temporary folder", I tried the solutions on the forum: define('...
4 votes
3 answers
8k views

Disable media library tab for non admins in uploader screen

I am developing a plugin in which i am required to allow front end users to upload media, which I am able to do. But I don't want to let them sneak into media library which comes as tab with uploader ...
0 votes
1 answer
2k views

How to solve `Error getting remote image` in woocommerce rest api script?

I'm using WooCommerce Rest API to upload images from another website using the img URLs. The script works well, but in 2 out of 10 websites I get this error: { code: '...
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 ...
1 vote
1 answer
2k views

Uploading .mp3 files http error - 2 "exact" files one successful other fails

I have 2 equal .mp3 files - technically different files but both exported from Audacity using the same settings and the same original audio. Exactly the same size, same content (albeit processed ...

1
2 3 4 5
41