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

learn more… | top users | synonyms (4)

1
vote
2answers
423 views

How to decrease the file size upload limit?

How do I decrease my media file size upload limit from 20 MB to 500 KB? I actually tried to follow the solution used in Decrease file size upload in Media but got a "undefined add_filter()" error. I ...
0
votes
1answer
2k views

wp_handle_upload returns empty error array

I am trying to do an upload via ajax and really dont want to use the regular wordpress media uploader. It is too much stuff and all i want to do is upload single image. I have everything working the ...
0
votes
2answers
19 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 ...
0
votes
2answers
25 views

Upload images and attachments from frontend form

I'm not very expert of wordpress and I'm trying to create a frontend form sending information to my php function through ajax. I'd need help about uploading images and files as attachments of the ...
0
votes
2answers
18 views

How to get images to show in Media when saved Via PHP

I saved a bunch pictures ( 2,000+ ) in a PHP script. I can see the list of files with adequate permissions for apache to view them in my /wp-content/2016/05 directory but They aren't showing up in my ...
1
vote
3answers
515 views

How can one update a theme on a live site without interruption?

So i have a WordPress-based site with a custom Genesis child theme. Once the site goes live, we are obviously going to need to make changes periodically to the child theme's code — modifying CSS and ...
1
vote
1answer
441 views

Add select field to media uploader that adds a class to the image

I'm looking for a way to add a <select> menu to the media uploader that will have two options: normal image, which will do nothing, and profile image, which will add a CSS class to the image if ...
1
vote
2answers
3k 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 ...
1
vote
2answers
939 views

Wordpress 3.5 Media Uploader - Only allow 1 upload and certain file types

I am trying to include the new WP Media Uploader in a Custom Meta Box. I found this tutorial: http://codestag.com/how-to-use-wordpress-3-5-media-uploader-in-theme-options/ However i am looking for ...
1
vote
0answers
62 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 ...
0
votes
1answer
441 views

Insert image in comment reply

I have searched everywhere but can not find a plugin that allows users to upload an image into their Reply to a comment. It is a photographic blog so has to have this ability. I did try a couple but ...
1
vote
1answer
15 views

wp_enqueue_media() Will not load JS on the theme

I've added wp_enqueue_media() to a specific page (before including the header) on my custom theme but it flat out will not any of the JS on the page. I've already done the basic troubleshooting: ...
0
votes
1answer
11 views

How to adapt upload_dir to save files outside of WP uploads folder

We have a CPT which is used to manage various assets including image, pdf, CAD and other files. Our client would like to keep these asset files seperate from their other media files and does NOT want ...
0
votes
0answers
32 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 ...
0
votes
2answers
60 views

Theme not showing after uploading

Hey I am developing a website for my client, and I'm having some issues with the theme upload. The theme I am uploading is http://themeforest.net/item/stockholm-a-genuinely-multiconcept-theme/8819050. ...
4
votes
1answer
746 views

Upload path/URL weirdness for the main blog of a multisite/network setup

We have a WP network (with domain mapping) that was started pre WP 3.5, so it was using ms-files.php and wp-content/blogs.dir/ to store media files. I wanted to remove ms-files.php dependency and ...
0
votes
2answers
2k views

Get image post ID in media upload

I am developing a plugin that adds a Custom Post Type to my theme. It's a retail directory and the post type is a retail listing. Everything is working fine. I can upload content to the DB and then ...
0
votes
1answer
24 views

How to make picture appear on wordpress site shared link? [on hold]

I would like to know how to make a piture appear on the thumbnail to the left of the text when I share a link of my wordpress on facebook. I dont post any images to the website, but would still like ...
0
votes
0answers
11 views

Send media uploads to different directories

I am making a website for my local primary school, and I have each class page as a separate page template. Rather than have all their uploads go into the general /uploads/ folder I'd like to direct ...
0
votes
0answers
9 views

Problem with the standard example of media_handle_upload

I have been trying to make a custom tab for the media uploader to treat some files and looked for a way to do such a thing, and found an example of it in the media handle upload page. The code I used ...
0
votes
0answers
20 views

Image upload - Cannot modify header information

i have an issue out of nowhere. Since a few days the upload of images doesnt work in 9 of 10 cases. The progress bar climbs to 100% but then everything stops and when going to the media library the ...
0
votes
2answers
2k 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 ...
0
votes
0answers
16 views

How to get attachements URL from author meta and display them?

I created a form for edit author with "WP User Frontend" and I use a custom meta field for multi upload images that can upload 6 images, with meta name 'management_certi'. My problem is I can display ...
1
vote
1answer
28 views

Original image not saving?

When i'm uploading a picture, WordPress doesn't save the original image, just the thumbnails? That's why when i'm setting a featured image, the link is broken. Any help to to save the original image ...
0
votes
1answer
2k views

Add SWF file to wordpress through custom template

I am trying to attach an swf file to my website. I have that swf file in my local system. But wordpress is not alowing me to upload the swf file into the media library. I want to add that swf to my ...
2
votes
2answers
601 views

wp_delete_attachment doesn't delete images in wp-content/uploads/

My function lets users delete their uploaded images in the front-end. However, they're only deleted in the Media Library. That means that they're still in wp-content/uploads/. public static ...
0
votes
3answers
2k views

unlink() doesn't delete the uploaded file

I'm using this code in my plugin to add an extra field to the user profiles so that the user can upload an image. It uploads the file perfectly but the only problem is the part that has to delete the ...
1
vote
1answer
19 views

How do I change the url displaying existing uploads?

I recently took over admin for a WP site and moved it to a new server/domain. I have changed the siteurl in the settings and the menu system works correctly but the links on these previously uploaded ...
0
votes
1answer
16 views

upload_max_filesize in .user.ini Not Reflected in Media Upload

I would like to know why Media Upload does not detect the upload_max_filesize that had been set in .user.ini file as shown below. max_execution_time = 10000 memory_limit = 512M upload_max_filesize = ...
0
votes
1answer
1k views

How to delete file uploaded by Plupload

I follow the steps from here to integrate the plupload in metabox. Everything is working fine. But I did find one disadvantage of this guide. When I click the 'Remove' link from the uploaded images, ...
1
vote
1answer
29 views

How do I only allow downloads that are referred from my domain?

I want to restrict downloads so that users are only able to access the /uploads folder if they click a link from my domain - i.e. they couldn't access any file in `/uploads' by pasting it into the ...
1
vote
1answer
56 views

Get User's Facebook Photos as Wordpress Upload

I am new and a bit of troublesome on how Wordpress work as I have plan to use it as CMS for my commercial website. I have been figuring out on how to make an image that I have retrieved from user's ...
0
votes
0answers
13 views

plugin settings - multiple upload buttons in sections: how does sanitize_callback work?

my plugin' settings page includes a series of sections, each one contains an upload button: // create the input with the *exact* setting's name function myplugin_upload_cb($args) { echo "<input ...
2
votes
0answers
28 views

How to implement secure frontend image upload? [closed]

I would like to implement an public image upload in my Wordpress Theme with ajax. What's the secure way to do this? I have read many about security problems when allow users to upload files to the ...
12
votes
2answers
5k 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, ...
4
votes
1answer
1k views

wp_generate_attachment_metadata returns empty array

foreach ($_FILES as $key => $file) { $uploadedImage = wp_handle_upload($_FILES[$key], $upload_overrides); pre_r($uploadedImage); if ...
1
vote
1answer
983 views

Specified file failed upload test. wp_upload_handle

So I managed to write a peice of code that allows me to upload a zip file, im not even sure where it gets uploaded too, and I am doing it on my localhost with apache in control (www-data). the code is ...
8
votes
9answers
8k 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 ...
3
votes
1answer
862 views

Remote upload file to server B

I'm aware this might be some of the hardest coding to do ever, but thought of giving it a try. Im basically trying to detect all (mp3) filetypes uploaded through the Wordpress media upload and send ...
0
votes
1answer
26 views

Moving Media Library

I downloaded all files from wp-content/uploads and copied to new Wordpres instance on localhost (Windows IIS Express also on MacOS with MAMP). Unfortunately in both cases I don't see my files in Media ...
0
votes
0answers
10 views

find uploaded files withouth a corresponding attachment in DB

We have a site with an upload directory that it's in a mess. There are thousands of files that exist on disk, but that don't have a corresponding DB attachment. At the same time, there are many ...
1
vote
2answers
651 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
2answers
445 views

How to check if uploaded file is .pdf not .jpeg?

I use a function in my theme that prevents upload of big size image files (thanks to @fischi), but I want to apply it strictly to .jpg/.jpeg files only, because it prevents to upload .pdf files too. ...
0
votes
1answer
42 views

Move a file from a directory to another

I have this function: function attachment_selectbox_edit($form_fields, $post) { $select_options = array( "no" => "No", "yes" => "Yes" ); // get the current value of our custom field ...
1
vote
1answer
1k views

The uploaded file exceeds the upload_max_filesize directive in php.ini

I'm trying to upload a XML file through Wordpress Importer It shows this error, no matter what the size of the file is. Even 10kb file throws up this error. My php.ini settings were set to 100MB, ...
0
votes
1answer
32 views

How to submit/upload data to database and in specific folder?

I am trying to make video plugin. Want to submit data to move the file in a folder which is in the plugin_name folder. To submit/upload I am trying the 'plugin_dir_path()' function. And it is not ...
2
votes
1answer
1k views

Shared upload folder in wordpress multisite

I have a wordpress multisite, where I would like all the images uploaded through the main site (mysite.com) to be accessible to sub1.mysite.com and sub2.mysite.com. All the images should be in one ...
-1
votes
3answers
498 views

tb_show not showing a media upload window . custom plugin

I can't figure out why the media uploader doesn't show. I'm trying to do a media upload window so the user can upload a file. The problem is, when I click on the Upload button, nothing happens, the ...
0
votes
0answers
25 views

Upload media Remote or Api

I couldn't find any accurate answers, therefore asking here. I have a website that runs multiple cron jobs in WordPress and generates posts from multiple resources with images and descriptions. I am ...
1
vote
1answer
653 views

Automatically Add Caption in image

I want to automatically add caption for each picture appears in the name of the image or the alternative text example Caption add automatic