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
0 votes
0 answers
7 views

Show a popup message when file is uploaded

I have to check if a file is already uploaded to the site when I upload a new file (it checks the md5 hash of the new file and compare it to all the other files' hashes stored into the database). For ...
user avatar
0 votes
0 answers
21 views

Some problems in custom widget

I made a custom widget for my template, which has an image upload section For the first time, I upload an image, it displays correctly, without any problem, but when I want to change the image, it ...
user avatar
  • 1
0 votes
1 answer
54 views

wp_handle_upload returns a critical error response or invalid form submission

Trying to make a plugin that can upload files directly to WP. Despite copying different blocks of code online, it seems determined to not let me upload it. The way I'm attempting is through a ...
user avatar
1 vote
1 answer
38 views

Generate metadata for cloud images

The current situation We use the AWS SDK for PHP to store media files on S3 instead of the server's local storage, and use the wp_handle_upload filter to point the inserted attachment to the S3 file ...
user avatar
0 votes
1 answer
27 views

How does Wordpress decides how many sizes of an image to create?

Once an image is uploaded to WordPress server, how does it decides how many sizes to create for the same image? I can see for one image, it didn't create any variants, but for a bigger image, it ...
user avatar
0 votes
0 answers
24 views

wp.media Uncaught TypeError: Cannot read properties of undefined (reading 'state')

Here in a JS class, I used "wp.media" to upload images. I can open the media popup by clicking a button. But getting this error (Uncaught TypeError: Cannot read properties of undefined (...
user avatar
0 votes
1 answer
27 views

How do I upload file through custom field, save it to database and get it

I have made a custom field without any plugin. When I choose file I want to upload that file and get its url on my page. Basically, I want to upload video and show it on frontend. This is my code ...
user avatar
0 votes
0 answers
19 views

Checking page before applying image restrictions while uploading

so users can upload images on my website and I want to put some restrictions on these images while they are uploading. The catch is that these image restriction can only apply on one page, being the ...
user avatar
0 votes
1 answer
18 views

Serving Images from subdomain in wordpress

This is my current image url https://example.com/wp-content/uploads/2022/06/sample.png served via cloudflare uploads folder is in my wordpress installation I am syncing the uploads folder to Backblaze ...
user avatar
  • 1
1 vote
1 answer
58 views

Disabling direct access to images using .htaccess

I have installed Wordpress in a subdirectory of a subdomain. I am using the following rewrite rule to direct all urls to this subdirectory. RewriteCond %{HTTP_HOST} ^(www\.)?mysubdomain.mydomain\. ...
user avatar
  • 13
0 votes
0 answers
19 views

"Can't update in WordPress"

WordPress changes can't showing. WordPress version: 5.5.3 Node version: 14.19.3 PHP version: PHP 7.4.29 npm version: 6.14.17 There is a website under development in WordPress. I edited the page in ...
user avatar
  • 1
0 votes
0 answers
8 views

Change image data durgin upload

I try to change image filename and image meta during upload to media library. I have a problem with create unique filename hence, a bad slug is generated. Also, during upload, file uploaded by this ...
user avatar
  • 1
0 votes
1 answer
21 views

How to stop media_sideload_image from running when deleting a post?

I have a code that downloads an image and saves it to the media library when you save a post that uses a certain block. The code runs perfect but downloads the image again if you delete the post. How ...
user avatar
0 votes
0 answers
14 views

WordPress not showing manually uploaded files in Uploads folder on Media Library

I'm having a script on my wordpress site that uploads file to my site directory at wp-content/uploads while .mp3 is the file extension uploaded by that script. This script worked successfully but when ...
user avatar
0 votes
0 answers
14 views

Why is the file not uploading to the server?

On wordpress page i am using inline vue, because form is too complex. let formData = new FormData(); formData.append("action", "topcare"); formData.append("nonce", ...
user avatar
0 votes
0 answers
27 views

Hook on file upload

I need a hook or some way to detect when the window to select the file to upload is opened. I'm talking about the window that opens the browser to select the local files to upload. Context: On ...
user avatar
  • 17
1 vote
1 answer
18 views

Migration to WP - Couldn't load image

Situation: I'm trying to migrate static page made with HTML/CSS/JS into Wordpress. The images won't load. They work in HTML, but when I migrate into PHP there are only alt-descriptions visible. Upon ...
user avatar
0 votes
0 answers
27 views

Cant upload larger than 100MB

I am using DO Droplet 2gb RAM Shared CPU running apache. I cant upload files larger than 100MB in the Media Uploader but I can upload LOWER than 100mb. I already tried modifying php.ini and other ...
user avatar
  • 1
1 vote
1 answer
21 views

Use custom image size in admin panel

I have add some image size like: add_image_size( 'custom-small', 600, 600 ); add_image_size( 'custom-medium', 1280, 1280 ); add_image_size( 'custom-large', 2560, 2560 ); and I have removed all the ...
user avatar
  • 13
0 votes
1 answer
51 views

Programatically upload a file to be stored inside blob field in database, NOT on filesystem

old php developer here, very.. very new to WP, so be kind. As part of a plugin, I am trying to allow files to be uploaded with the intended destination storage in a specific table. I have the ...
user avatar
0 votes
0 answers
17 views

Images not uploading on product page of woocommercr

Images on showing on product page and also on all product list. Product image not showing enter image description here
user avatar
0 votes
0 answers
12 views

How to download CSV from sub directory in uploads folder

hello guys i donot have experience working with the csv. I have a very big form i wanted to make a custom csv export for this form and a new csv is generated every time the form is submited. i am ...
user avatar
0 votes
1 answer
46 views

Double Slash After Media Path (uploads//)

After performing an SEO Audit on my client’s website I found out that several images have a double slash in their URLs. This seems to be happening just to media files, and the double slash is ...
user avatar
0 votes
0 answers
19 views

Filter Media by attached page or blog post in Library

I am trying to create a filter using restrict_manage_posts that will filter all media according the page or post type that have been attached to. Actually i need to create a filter that refers to the ...
user avatar
1 vote
0 answers
36 views

Offload Media Library to other domain on a different server

How is it possible to change the media storage of Wordpress to a subdomain on a different server. The main domain example.com running on a server pointing to IP 192.168.0.1 and I've created a ...
user avatar
0 votes
1 answer
53 views

Is it safe to upload JSON files to upload folder?

I'm using wp_upload_bits to upload JSON files to my WP's upload folder. I get the error "Sorry, this file type is not permitted for security reasons" Is it safe to upload JSON file anyway?
user avatar
3 votes
0 answers
124 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 ...
user avatar
0 votes
0 answers
21 views

Problems with uploading pictures to WordPress

When trying to upload pictures to WordPress I face big problems. Sometimes it does not work at all and sometimes I need to try several times. Some pictures I even never managed to upload. I tried ...
user avatar
  • 1
0 votes
1 answer
44 views

Why does get_dirsize return the same size?

The function below is intended to return the size of the base directory. Although additional files have been uploaded, it continues to display the same size. What am I missing? function get_space_used(...
user avatar
  • 151
0 votes
0 answers
10 views

protect files from downloading on other than my site

I have a website Files apk I store these files on a separate server How do I make downloading these files only through my site? I mean, the person who clicks on the download link on my site starts the ...
user avatar
0 votes
0 answers
91 views

Problem with inserting multiple images in gallery of each WooCommerce product programmatically

I am creating a script to programmatically add multiple images to the gallery of each WooCommerce product. The script works but only takes the first image, I'm having a hard time figuring out how to ...
user avatar
  • 1
-1 votes
1 answer
80 views

wp_temp_dir does not change the /tmp temporary default directory

I have a problem changing the temporary folder. I have have define the new temporary folder using define( 'WP_TEMP_DIR', dirname(__FILE__) . '/wp-content/temp/' ); before the line /* That's all, stop ...
user avatar
  • 3
0 votes
0 answers
164 views

Setting wp_temp_dir and permissions not working for "Missing A Temporary Folder" error

I have a problem uploading files to my main webpress site (e.g. www.main.com) and all the other pages that live in it (e.g. www.main.com/anotherpage). I know there is a method to set a temp folder ...
user avatar
  • 3
0 votes
0 answers
24 views

How to display a warning when an uploaded image is too small?

I want to display a warning when a user uploads an image with too low a resolution. I don't want to block the upload, just give a warning. The only option I see is wp_handle_upload_prefilter, but ...
user avatar
0 votes
1 answer
61 views

Use wp_handle_upload outside of a POST

I'm writing a script that will prefill my custom post type with posts. Each post has a file (zip or json) as post meta that has to be uploaded to the media folder. The problem is wp_handle_upload ...
user avatar
0 votes
0 answers
26 views

Change Link to Upload folder

I'm working on a restyling of a wordpress site, which has an upload folder of almost 120gb. I made a copy of the entire site except the upload folder, I would like to avoid it, to make quick copies of ...
user avatar
  • 1
0 votes
0 answers
19 views

How to get file object from file_attachment?

I followed this code and so far I could get the file attachment object. But I can't seem to get the file. I need the file object to upload to IPFS via Javascript. (function($){ $.extend( wp....
user avatar
0 votes
1 answer
25 views

wp not defined at wp.Uploader.prototype

I followed this code as below but it gives me the error "wp not defined". I placed the code inside footer.php in my child theme and also in functions.php but both are erroneous. (function($){...
user avatar
2 votes
1 answer
44 views

Media library storing files in uploads not folders within in uploads

I am working on a site rebuild, I need to preserve about 100 blog posts that include images. I was having issues exporting the images and I decided to just download them via FTP. However, I found a ...
user avatar
0 votes
1 answer
32 views

Does wp_get_attachment_image_src also work with non-image files?

I wish to get the file path to files other than images like PDF or TXT that are uploaded. Should I use wp_get_attachment_image_src or there's other function more suited for non-image attachments.
user avatar
1 vote
0 answers
25 views

How to enable sorting in custom media uploader in plugin

In my plugin I need a media uploader exactly like the one you see when you select a post's featured image. I managed to do almost everything with this code: media_uploader = window.wp.media({ ...
user avatar
  • 21
0 votes
0 answers
132 views

How to upload large media file in chunks, without any plugin?

How to upload large media file in chunks, without any plugin ? I have done something like this, it's uploading the file, but after uploading the media file, the uploaded file is not visible in media ...
user avatar
  • 13
0 votes
0 answers
21 views

How to locate the js code and php code for certain function?

For example, I want to debug the code for uploading an image when composing a post. I click the "Add Media" button, right-click on the "Media Library" tab, click the "Inspect&...
user avatar
  • 103
1 vote
1 answer
26 views

How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product

How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product. Because I want to make a photo album blog, the images within each post ...
user avatar
  • 11
0 votes
0 answers
38 views

PDF Upload from Input Error

I have a custom plugin that creates an input field under each post, that allows users to upload PDF files. $html .= '<input accept="application/pdf" type="file" id="...
user avatar
0 votes
1 answer
22 views

I can't set image ad fatured programatically

I have a problem when I try to set image as featured. I don't know where is the fail, I upload the image from a URL in the same server and then try to set it as featured. The code upload the image but ...
user avatar
  • 1
0 votes
0 answers
37 views

Migrating Wordpress Uploads To S3 Object Storage

I currently migrate my wordpress media to s3 bucket. Does any one know of a way to redirect all the existing image urls to the s3 bucket instead if we manually copy the files over? Could this be done ...
user avatar
0 votes
0 answers
75 views

Safe to allow json uploads

So I would need to get form on my website where people can upload json files to my site and then others can download those. But is there are security issues that could come up with this? Or any other ...
user avatar
0 votes
0 answers
282 views

Using WP-CLI "wp media import" to sync files to the media library

I'm rebuilding an old website which is 3 years old. The new website has a different sitemap and media files. For this, I have created a fresh WordPress install. However, I'd like to maintain the old ...
user avatar
  • 1,923
0 votes
1 answer
143 views

How to limit the number of images displayed in the media window?

I have a lot of images in my website, so when I open wp-admin/upload.php the server slow down. Would be possible to display only 50 images per time? I saw there is this similar question, but it works ...
user avatar
  • 127

1
2 3 4 5
39