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.

0
votes
0answers
14 views

Remove special characters from filenames

I have a website that i transfered recently from one host to another. Unfortunately when i did that, i noticed that all the images that had special characters in it lik (é, è, à, ...) weren't showing ...
0
votes
1answer
27 views

how to change wp upload directory to another domain directory

both main and second domain (addon domain ) are in same host i want to find a way to change upload directory to another directory that located in another domain root. default location (first location)...
0
votes
2answers
32 views

Why does SVG upload in Media Library fail if the file does not have an XML tag at the beginning?

I have enabled SVG uploads using this code: add_filter('upload_mimes', function($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; }); However, uploads of SVG files that start with the &...
0
votes
0answers
18 views

Upload file and create a page for it

I would like to make possibility for users to upload a specific files on my page. In example let it be a txt file. When txt file is uploaded I want that it will create a post/page with data about this ...
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 ...
1
vote
0answers
24 views

(Woocommerce) How to add a custom page between cart and checkout with a file upload field per product item in the cart?

I am using Woocommerce. I want to add a custom page in between the cart and checkout page. In this custom page, I want to show a file upload field per product item in the cart. This has to tie into ...
0
votes
1answer
23 views

Change upload URL by mime type

I'm working on a site that has several hundred pdf files uploaded over the course of a few months. All uploads are organised in the uploads directory by year/month. The client has just decided they ...
0
votes
0answers
6 views

woocommerce with external ftp site

i am creating a site with wplms theme use woocommerce for selling part. i am trying to use another host for files(host run minimal php that use x-accel-redirect functions) and i want to limit ...
1
vote
2answers
12 views

Remove upload file types filter for admin

Does anyone know if there is a function to remove/bypass file types uploads filter (specifically for admins). I know there are plugins available but they often break or don't contain ALL the mime ...
0
votes
2answers
29 views

Upload restrictions - upload_mimes - filter: Adding multiple MIMEs for a single extension and adding multiple extensions for a single MIME type?

Trying to add certain allowed MIME types to the upload filter - currently my custom function looks like this: // allow SVG and video mime types for upload function cc_mime_types( $mimes ){ $mimes[...
-2
votes
0answers
17 views

I can't upload any article on my blog by using the Android application. I have this message GENERIC ERROR [duplicate]

I am facing an issue since today. I can't upload any article on my blog by using the Android application. I have this message GENERIC ERROR.
-1
votes
0answers
16 views

Artical Not Publish,Say GENERIC ERROR,. How To Fix GENERIC ERROR in WordPress App [duplicate]

I can't upload any article on my blog by using the WordPress Android application. I have this message GENERIC ERROR. How to fix or solve this GENERIC ERROR??
0
votes
0answers
8 views

Android WP App unable to upload images

I'm trying to solve this problem, but I can't find a useful response. I've took a look in Can't upload media, permissions are correct and changed upload_path and upload_path_url to respective ...
0
votes
1answer
26 views

HTTP error 500 when uploading files from Mac but not from any other device

I've tried to upload a few files to Wordpress. Every time I do this, WordPress responds with an HTTP error 500. I can't upload themes either. Whenever I try to upload, I do it on my computer (Mac), ...
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
1answer
23 views

Refactor File Upload to check for existing filename and append -1, -2, -3

I have an existing front end file upload works perfectly, but I'd like to have it check if an existing file has the same name and append "-1", "-2", "-3", and so on… I've searched and found a ...
0
votes
1answer
92 views

“upload_mimes” filter not working. Need to allow WOFF and WOFF2

I'm working on a theme settings page and I need to allow uploading WOFF and WOFF2 files. Getting the Sorry, this file type is not permitted for security reasons. message at this time. My code: ...
0
votes
0answers
9 views

How to upload a file to a different directory, but not its preview images?

I use a filter (in my custom plugin for my website) to force upload of files loaded with an Ultimate Member plugin form in a directory different from the default 'uploads' one. The filter works ...
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
12 views

Metabox Upload custom MIME file type not show in Media Library

I have made a theme to allowing uploading of files like GLB format to be used in WEBGL 3D rendering in a post. Here's the code for adding supported file type: function my_myme_types( $mime_types ) { ...
0
votes
0answers
8 views

Show Files From Specific Directory in Custom Media Uploader

I want to upload/show files to/from a specicific directory in a Custom WP Media Uploader. For reference, I am using this tutorial https://github.com/smartcatdev/WP-Media-Uploader Here I only ...
0
votes
0answers
9 views

Auto insert media file when drag'n'dropping inside post

the current workflow of drag'n'dropping an image inside a wordpress post edit automatically opens the media library, and you have to click the insert into post button. Is there any way to ...
1
vote
1answer
41 views

how to get URL of media uploaded to WordPress via media_handle_sideload()

I'm trying to upload a photo from an URL then set it as the feature image of a product that user is submitting Now I can do the first part of this function the problem is I can't get the new URL of ...
0
votes
0answers
47 views

How can I programmatically add WooCommerce product photo from external URL

I searched for this but couldn't find anything I already saw this post Programmatically adding images to media library the problem is you cant get the new media url right away and put it as meta data ...
0
votes
1answer
34 views

multiple image upload using wp_enqueue_media

I have created a custom plugin and there has an image upload option. In view page: <div class="form-group"> <label class="control-label col-sm-2">Trade Photo:</label> ...
0
votes
0answers
37 views

ACF - Get file size

I'm using Advanced Custom Fields to display some uploaded items on the website, but I also need to display the size of the files. I have this code: $filevalue = get_field('file_bestand'); $filesize =...
0
votes
1answer
27 views

How to require files in a custom endpoint

I am working on a custom endpoint to handle ajax media uploads with media_handle_upload(). I have created a custom endpoint with a route that is tested and works, however when I try require the ...
0
votes
0answers
22 views

Conditionally watermarked post image

I have a plugin that adds a watermark to certain image sizes when a post with a specified meta field is saved, if it has an image that should be watermarked. It uses WP_Image_Editor to add/position ...
0
votes
1answer
21 views

Where to upload JavaScript file in WordPress

I am using the headers and footers plugin to call a small script I made by pasting the script directly into the user interface of the plugin. However, I would like to upload a JS file and call that ...
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
0answers
10 views

Wordpress Media URL is showing // in URL

I am facing a problem my website media URL are showing like domain.com//media due to this my website is working fine without SSL but when i open it with https:// all my media images disappear. I want ...
2
votes
1answer
30 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 ...
0
votes
0answers
19 views

Upload automatically html files

I have about 1400 html files and I want to upload them in a wordpress site where I am administrator. I want to publish them as blog posts. How can I achieve that automatically? Thank you.
0
votes
0answers
12 views

Possiblity of bulk restore original image

Is there a possibility to use a bulk restore function of cropped images? At the moment the only possibility to use this is on each single image: Is there a way to apply this to all pictures in my ...
0
votes
0answers
53 views

Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?

I'm currently using a plugin that generates a PDF for customers but the URL is way too long. For eg - https://www.mywebsite.com/wp-content/uploads/pdfuploads/666666.pdf. Here's the specific code from ...
0
votes
0answers
20 views

Using unzip_file() to get contents of file

With each post, I save a zip folder as an attachment containing a json file with large amount of data. When looping through posts, I need to open this folder and retrieve the contents of json file but ...
0
votes
1answer
16 views

Plugin writing: access file that was just uploaded

I am having trouble finding a solution for following problem: The user should upload a file in the menu of my plugin; the file is uploaded to the media folder by using media_handle_upload(file), ...
0
votes
0answers
9 views

External file server, to store and exchange files between wp-frontend and c#/winforms application

This is my first question here, so please bear with me. I hope its not too unspecific. Im stuck since several days now and i dont seem to find the answer myself. What i want to do: I want to build a ...
-1
votes
1answer
53 views

Can't upload files 1MB+ [closed]

I can't upload files with more than 1MB, but i haven't change any configuration. I have a lot of files with more than 5MB uploaded before, but i don't know why now i can't... The error is "Failed to ...
0
votes
0answers
14 views

Uploading images causes LogOut

We are experimenting an peculiar problem randomly when we upload an image. No matter the size or kind of image this will trigger a logout to every user that is uploading in a post the images. We ...
1
vote
0answers
8 views

Add media library items to Menus using the Customizer (via Media Manager not URL)

You can add links to files in the media library URL via the Custom Links panel of the Customizer but for clients this requires multiple steps including cutting and pasting a URL from the media library ...
0
votes
0answers
24 views

How to include a video upload in a custom widget inside a plugin?

I tried to add a video upload inside a widget which is inside my plugin. I did a widget class Home_Parallax_Video which extends WP_Widget to do it based on WP_Widget_Media_Video. The form contains ...
0
votes
1answer
38 views

Uploading images to custom table

I'm building my own WordPress plugin and I have a form where I put in some data. In addition, every entry has an image. Does anybody know how I can upload an image using the WordPress media selector?
0
votes
1answer
48 views

Front-End Upload media with category

Hello i have a page with a little uploader to upload media in the library, here is my code : <?php $post_id = $post->ID; if ( isset( $_POST['html-...
0
votes
0answers
26 views

Automatica crop image in wordpress 5.1?

original image size 777x518 when uploading this image it shows only 575x416 in WordPress 5.1. It automatically crops this image.I want, When uploading an image it will display your original size. How ...
0
votes
0answers
21 views

Upload and configure WordPress

I'm trying to install WordPress for my website, and I need it to configure but I don't know how. The web hosting company does not use cPanel. I downloaded the WordPress .zip file from the official ...
0
votes
0answers
55 views

Images uploaded via Gutenberg image block are cropped

I'm trying to add images to a post with the following work flow using the Gutenberg editor on version 5.1. Add an image block -> select upload -> select image. The image is uploaded to the page and ...
0
votes
0answers
61 views

Add Media button of WP_Editor on custom role profile page not working

I have a custom role defined which has a separate profile page in the front-end. In the profile page there is a wp_editor with Add Media button. But the image is not being attached. This is the error ...
0
votes
0answers
88 views

Upload mime types for ai illustrator file

Maybe this topic needs updating because i have certainly used this in the past, but today adobe illustrator ai files are not uploading. So I'm using gravity forms plugin to upload my files. When I ...
0
votes
0answers
9 views

Can't upload an image with Guttenberg or Media Library

I had previously built a site using the Guttenberg editor for myself back when it was an opt-in beta, and I had no issues getting that site up and running, or uploading images. Yesterday, I started a ...