Tagged Questions

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)

0
votes
0answers
14 views

Could not upload image in admin panel while making a plugin in wordpress

I am trying to make simple plugin but my problem is image which can not appear in admin panel... Here is my code: class DM_options{ public $options; public function __construct(){ ...
0
votes
2answers
35 views

Why images/photos after being uploaded to my wordpress site get slightly blurry?

I am trying to figure out the problem stated in the title. Every image/photo I upload to my wordpress site gets slightly blurry. I format them according to my wp theme requirements, however after the ...
0
votes
2answers
24 views

Unable to upload images using the Media Library

I have had a site that has been working perfectly for the past few months. Then all of a sudden when I go to upload an image via the Media Manager on the Admin Dashboard I get a 500: Internal Server ...
1
vote
2answers
35 views

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']) ; ...
0
votes
1answer
22 views

Private file system for attachments

Is there a way to make an attachment private? This also includes moving the files to a separate folder for private attachments, even if it's a sub-folder of uploads, to restrict anonymous access ...
2
votes
0answers
16 views

How to get profile user id when uploading image via media uploader on profile page

I have a PlugIn which lets a user upload an image to a user profile in the backend. Now I want to access the user id in the uploader to change the filename of the uploaded image. On the user profile ...
1
vote
0answers
12 views

How to get the last selected media alignment setting?

The default media uploader for inserting into a post retrieves the last selected alignment setting that was used. How do I retrieve that for use in my plugin?
0
votes
2answers
35 views

Theoretical limit of upload file size [duplicate]

I want to setup a CMS on WP, which should contain a page, allowing to upload and download big files. We are expecting to use an Apache-server running on Ubuntu. Assuming to adjust values, such as ...
0
votes
0answers
18 views

Upload image by url

I want upload image by url: $upload_dir = wp_upload_dir(); $image_data = file_get_contents($post_photo_url); $filename = basename($post_photo_url); if(wp_mkdir_p($upload_dir['path'])) $file = ...
0
votes
0answers
11 views

Proper permisssions for a file in uploads directory to be viewable by admin but not by public

What would be the proper permission to set for a file in wp-content/uploads so that it is not publicly viewable but can be accessed when logged into the admin area? Example - a user uploads a photo ...
0
votes
1answer
21 views

Post Type Upload Directory - {post_type}_upload_dir filter

I'm working with modifying the upload directory depending on which post type is being uploaded to. I've ran across this question: Post type specific upload folder in 3.5 and one of the lines confused ...
0
votes
1answer
13 views

What's the database relationship between a post and its attachments

I'm creating a custom import script to migrate CSV data into wordpress. Each post has a series of attachments that must come with it. Following chapter 14 (importing via a custom mysql script) in the ...
0
votes
0answers
24 views

wp_upload_bits - define (sub)folder / (sub)directory before filename?

I have this code for a plugin I'm using. $comment_image_file = wp_upload_bits( $title . $user->user_login . $comment_id . '.' . $file_ext, null, file_get_contents( $_FILES[ $comment_image_id ...
0
votes
2answers
53 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
0answers
20 views

Is custom behaviour possible when asynchronously uploading?

I'm using Plupload and making use of wp-admin/async-upload.php to allow my website's users to upload images from the front-end asynchronously. The default behaviour of that particular script is for ...
1
vote
1answer
29 views

Change wp-content/uploads to uploads/%postname%/%image%

When uploading an image to a post, I want to change it so that it grabs the postname or post_id and places it in a folder like uploads/%postname%/ Is there a simple method of doing so? thanks
-2
votes
0answers
8 views

How to have users upload photos and then site show most popular photo of the week?

Title says it all. How to have my users upload their own photos to the website... so then I can have a Most Photo of the week/day in the sidebar (generated by the site) ?
0
votes
0answers
16 views

How to resize an image server-side before upload?

I've been trying to resize an image client-side before uploading (see this question). I'm now trying to resize server-side before uploading. I think wp_handle_upload_prefilter is the filter I should ...
1
vote
0answers
80 views

How to resize image on client-side before upload?

I've been using Plupload to resize images on the client side before uploading them to the server. I've implemented a front-end form which lets the user select a file from their computer and submit it. ...
0
votes
0answers
15 views

How to change where WordPress is looking for uploaded files?

I have a multi-site setup. My main site's theme changed the uploads folder to /media, problem now, is I added a subdomain site, and when I upload a file, it still uploads to /media, and wordpress is ...
0
votes
1answer
33 views

Insert Image automatically when upload finishes wordpress media uploader

What I am trying to do is - 1) User clicks "Add Media" 2) Select an image 3) Image uploads finishes 4) Now it should insert into post automatically without pressing "Insert into post". Anywhere ...
0
votes
1answer
35 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?
0
votes
2answers
43 views

How to fix the orientation of images when uploading via the WordPress Media Uploader?

I've been using the Image Rotation Repair plugin to fix the orientation of images when uploading using the Media Uploader (some images taken on my camera phone are not rotated on upload, resulting in ...
0
votes
1answer
62 views

HTTP Error when trying to upload image

I'm getting an HTTP error when trying to upload an image. The image is 6MB, yet I was able to upload a 10MB image just previously. I set the following, but they did not help: ...
0
votes
0answers
20 views

WordPress Custom File upload meta box saving 0 bytes as File size

I am trying to save custom images with the custom post type , so i added a custom meta box for file upload . it seems it is working fine but when i upload any file it save the file size is 0 Bytes . I ...
0
votes
2answers
53 views

Error when upload images larger than 1024px [on hold]

I'm stuck on a problem with uploading files. When I try to upload an image with 1024px or more, WordPress displays an error: Error sending. Try later. After reloading the media page, the thumb of ...
2
votes
0answers
64 views

Wordpress Media mime type filter problem 4.0

I have added new mime types with the 'post_mime_types' filter eg. PDF, doc, mp3 etc... Filtering by custom mime type on the upload.php page in media grid view works as expected but in list view it ...
0
votes
0answers
12 views

Display all 'uploaded to' images for a page/post in 'edit' admin area

I'm using the Frontend Uploader plugin in order to allow people to allow images to posts. This allows images to be 'attached' to posts. I can display a gallery of all attached images on the frontend ...
0
votes
0answers
18 views

Thumbnails produce unwanted gray pixels on white background

Is there a workaround for producing QUALITY "Featured Image" thumbnails of different sizes? WordPress produces compressed thumbnails that contain grey pixels where it should be a completely white ...
0
votes
2answers
52 views

How to download files to Wordpress?

How can I download file to wordpress? I mean, we have a link of a file for example http://example.com/myVideo.mp4 which is a large file. So I'm not able to download it to my computer, then ...
1
vote
1answer
31 views

Customizer: Unique identifier that distinguishes which image upload control is uploading an image

In the Theme Customizer, I've got a custom add_action('wp_handle_upload', 'upscale_responsive_bg_imgs') which upscales responsive background images when uploaded from the theme customizer. It's ...
0
votes
0answers
24 views

Serving images from a subdomain: image upload not working and no error given

I have a two stage Capistrano setup using Wp-Stacks. I would like to have a common image upload directory for them, since the image dir is 2GB, don't want to duplicate that. I'm trying to serve ...
0
votes
0answers
28 views

Files larger than 500 kilobytes are not allowed

This is a very strange problem as illustrated on the picture
0
votes
0answers
53 views

Used Duplicator to transfer a site. Now my media uploads aren't working

I deleted an image from the Media tab and when I tried to upload another, I started getting this error: The uploaded file could not be moved to wp-content/uploads/2014/10 I tried CHMODing the ...
0
votes
1answer
34 views

Where does wordpress store the FTP credentials?

When wordpress asks for FTP information to upgrade, you type it in and then it seems to store it for future use (for future upgrades, and maybe also for media uploads?) Where does it store these ...
0
votes
0answers
14 views

The most of the images don’t appear, although URLs are correct

I don't understand. The most images on my website Eslovaquia.sk don't appear despite the fact that all are in a valid folder. E.g. logo. There is broken-image-icon instead the logo in the header. ...
0
votes
0answers
59 views

Wordpress Media Upload Plugin 3.5 JS PHP

I have a small issue creating a small plugin. I am trying to achieve a gallery meta box using Media Upload 3.5. At this point I am able to upload images, but when trying to update the image. I wont ...
0
votes
1answer
23 views

Run filter if only it was run from specific admin page ( 'upload_dir' changed )

The situation is following: In WordPress, there is a plugin page created with optionality to upload media files. The code added to this plugin, that changes the upload directory by adding of filter ...
0
votes
0answers
13 views

Problem uploading file with wp_handle_upload

I use the wp_handle_upload function in my plugin to upload a file to the uploads directory. The plugin works fine on my local development site, but when I use the same plugin in my online website I ...
0
votes
0answers
19 views

Thickbox / image upload empty on library

Uploading images on WordPress using metaboxes is always a pain. Plugins desactivated, I have an empty media library using an upload button in a metabox. The count is good though. Scripts are ...
2
votes
0answers
80 views

Saving data-URI to media library

I have a TinyMCE plugin that generates PNG images using HTMLCanvasElement.toDataURL() (MDN). Currently, I'm just displaying them on the backend by putting the data-URI in an image tag, but I'd really ...
0
votes
1answer
29 views

How to upload unknown file type?

I've already read about mime types in wordress and how to add them, but I can't find any documentation about the correct type of files. For e.g. after a lot of research I find out that the epub ...
1
vote
0answers
37 views

How to protect specific uploaded files from being accessed by non-logged-in users in WP-multisite

I have a question that I thought the below thread would provide the answer to, but things in WP have changed so it doesn't quite do it, although it helped my understanding of things. How to protect ...
0
votes
3answers
169 views

Missing a temporary folder despite settings in wp-config.php

When trying to upload media to my Wordpress 4.0 running on a shared Apache 2.2.14, PHP 5.3.2 host, I get the error message "Missing a temporary folder". I have no influence over the php.ini which is ...
0
votes
0answers
11 views

Adding photoship mime type in plugin

I read over other posts about adding mime types, but I am still unsuccessful. Here is the code in my plugin: add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( ...
0
votes
0answers
14 views

Preventing a user from inserting a gallery using the Media Uploader, causes errors

As the title suggests I am trying to prevent a user from inserting galleries. This can be achieved with: function remove_media_library_tab($tabs) { if(!current_user_can( 'administrator' )){ ...
3
votes
1answer
138 views

Create image formats with different qualities when uploading

I'm trying to come up with a solution where the generated image formats cover both responsive and high-resolution aspects when uploading a new item in the WP admin. I've put together a set of formats ...
0
votes
0answers
35 views

Allowing images only when uploading files

I want to allow users to upload .jpg .png and .gif files only. I've tried hooking to the wp_handle_upload_prefilter filter like this: function custom_upload_filter( $file ) { $mimes = array( ...
0
votes
1answer
35 views

Wordpress File URL Path Incorrect

I have images uploaded to a Wordpress site and they can be accessed by the following URL: http:/eatdrink.ca/content/uploads/2014/09/FoodWebSummer-main-420x194.jpg but Wordpress is giving the ...
1
vote
1answer
34 views

Is it safe to allow non-admin users access to media uploader

Hi fellow Wordpress users :) I wanted to ask is it safe to allow non-admin users access to WordPress media uploader. Can they inject a virus while uploading media? How is WP system fighting against ...