Articles of uploads

Change default uploads file using wp Skeleton

I am using WordPress Skeleton (https://github.com/markjaquith/WordPress-Skeleton) which pulls the themes etc out of the wp directory. I am trying to set it up so uploads have a custom url (eg: site.com/custom/url instead of site.com/uploads). var_dump(wp_upload_dir()); Gives me: array ‘path’ > ‘/file/system/path/www/wp/core/assets/2014/08’ ‘url’ > ‘http://site.local:8888/wp/core/assets/2014/08’ ‘subdir’ > ‘/2014/08’ ‘basedir’ > ‘/file/system/path/www/wp/core/assets’ ‘baseurl’ > ‘http://site.local:8888/wp/core/assets’ ‘error’ > […]

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 network of sites. My plugin installs several image files into each site’s respective upload directory then calls wp_insert_attachment to get the images into each site’s media library. I have that figured out. What […]

How to implement secure frontend image upload?

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 server. And is it possible to prevent malicious images?

(resolved) Uploading images from a custom page using blueimp uploader?

I’m working with a frontend upload form that uses blueimp jQuery-File-Uploader to do all the heavy lifting … but, after attempting to add the necessary WordPress functionality to blueimp I started running into some errors that I am unable to figure out. Update / My code HTML (the frontend form): <form id=”fileupload” action=”” method=”POST” enctype=”multipart/form-data”> […]

Upload Button in meta box not opening library

First, thank you for your help. I have created a custom template, added two metaboxes in Pages using a ‘Page_Fiche_Metier.php’ template. One meta box is to upload an image. But the Upload Button is not opening the media library, although I have added the jQuery script. Here is the code for the meta-boxes.php <?php function […]

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 media manager. In my specific instance, I’m trying to integrate the Getty Images plugin with a select attachment modal (e.g., Featured Image). Currently, I’ve […]

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/uploads/images/) And all the zip files within another location/path (eg. wp-content/uploads/products/) But what I am needing is when I […]

Upload a json file in php

I’m trying to upload a json file through PHP. This is the code that i have yet. if( isset( $_POST[‘upload’] )) { $target = “/”; $target = $target . basename( $_FILES[‘upload’][‘name’]) ; if(move_uploaded_file($_FILES[‘upload’][‘tmp_name’], $target)) { echo “The file “. basename( $_FILES[‘uploadedfile’][‘name’]). ” has been uploaded”; } else { echo “Sorry, there was a problem uploading […]

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 wp_handle_upload_prefilter to check for supported file However this filter will affect all other media uploader as well. I think, if it […]

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 manager’s js file, configure it. listing file with json API. If you could help me figure out which all js/php […]