The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
12 views

Why wordpress can't generate metadata of big images

I have the following upload routine (compact): $movefile = wp_handle_upload( $file, $second ); ... $attach_id = wp_insert_attachment($attachment, $filePath); $attach_data = ...
0
votes
0answers
26 views

Custom upload directory for each file only for current plugin

I have a custom plugin to add project documents in my Wordpress site. Now these documents should be stored in their respective project folder such as: EN001/Document1.pdf EN001/Document2.pdf ...
0
votes
0answers
58 views

PHP upload multiple files with different input field names using media_handle_upload

I'm trying to upload multiple images with different names from input fields on my WP site. The images will be attached to the post as metas. postThumbnail will be the post's featured image and ...
0
votes
1answer
32 views

Issue with wp_handle_upload

I am trying to upload a zip file from Setting Page. I have designed a setting page and in that I have a file upload functionality. I am using setting API to do this. My issue is: I know that maximum ...
2
votes
1answer
30 views

Disable drag and upload in Media Library

Does any one knows a valid/standard way to disable drag and upload when accessing the media library in the admin area? In order to make this sense to you, I'm building a multisite and user of sub-site ...
0
votes
1answer
160 views

Upload multiple image with media_handle_upload with multiple file field [duplicate]

I need to add multiple images with image descriptions form wp admin. Admin Form: <label for="image[]">Image</label> <input type="file" name="image[]"/> <label ...
0
votes
1answer
56 views

image upload error wordpress

i am trying to upload image it is uploaded successfully but when i tried to access it in phpmysql the link is somethig like this : http://localhost/job/?attachment_id=40 i want to store this image ...
0
votes
2answers
87 views

Custom Upload Adds Ghost File

I've tried this on a fresh install on the twentyfifteen theme. I'm adding a metabox to pages which allows uploads - Whenever I upload a file on a new Page it uploads the file but also adds another ...
0
votes
0answers
45 views

Replace upload system/Override wp_handle_upload

I am going to be running a WP site on Heroku, and none of the current solutions for the media library fit my needs. There is a system for Amazon S3 (not using because paid), and a mapping system for ...
0
votes
1answer
360 views

Change Wordpress Upload Folder using wp handle upload

Below code is for uploading file through a form ... I want to change the default upload path for the upload to a folder called abc in the root of my theme. I hope somebody can help me with this Below ...
0
votes
0answers
126 views

media_handle_upload changes the file name

I am using media_handle_upload for my custom plugin using php. base from this example https://codex.wordpress.org/Function_Reference/media_handle_upload and I am using this code base on the example : ...
0
votes
0answers
139 views

How to upload multiple Image for use registration form in wordpress?

I have following code in my registration form plugin to upload single image in media library.please suggest me to implement this code to upload multiple image. <td>Image: </td> ...
0
votes
2answers
768 views

Modifying an uploaded image with 'wp_get_image_editor' and 'wp_handle_upload_prefilter'

I'm trying to intercept an image upload, resize it and then just let the upload continue. I'm using the filter wp_handle_upload_prefilter that passes as an argument a single file $FILES array. I ...
0
votes
0answers
529 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 ...
2
votes
0answers
533 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
16 views

Attach previously uploaded file to post

I am working on a script to upload data to a create a post with an (already uploaded) file attached. The file is located in the wp-content/uploads folder, but not added to the media array. How could ...
0
votes
0answers
69 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( ...
1
vote
0answers
105 views

frontend image post uploader

I've set up image uploader on front end custom form for users with some text input, textareas etc .Everything works fine, untill I decide don't upload any image. Then my "thank you" page gets blank. ...
1
vote
0answers
412 views

capability for upload on front-end (An error occurred in the upload. Please try again later )

We have a front-end form with wp-editor on front-end template page. Everything is working fine. but the only problem is "we can't add new images on front end form". there is an error "An error ...
0
votes
1answer
3k views

How to upload multiple images on frontend to ACF gallery using update_field

I'm trying to save images submitted on a frontend form in a way that they are accessible via the ACF backend. In how to upload an image on ACF with update_field on wordpress, someone provided a ...
0
votes
0answers
154 views

using media_handle_sideload() to add mp4 files to Media Library

For a site I'm building (for a client), I've written a shortcode, where the poster can enter [vine id="..."] followed by the ID of a Vine video. When the post is saved, my PHP functions will then go ...
-1
votes
1answer
333 views

wp_handle_upload Image sizes

What's the simplest way of getting wp_handle_upload To either change the size of the image it is uploading, or to get WordPress to generate the 3 sized images like it does in "crunching" when adding ...
0
votes
0answers
101 views

Wordpress will suddenly stop saving files uploaded by my code (ran in nopriv ajax)

I have some code that uploads a file. I've tried both wp_handle_upload as well as regular PHP code and with both, it will claim it uploaded the files (wp_handle_upload returns an array with "url" and ...
0
votes
1answer
151 views

Upload file without attaching it to a POST

I've brought files with html file field and I'm trying to attach file to wordpress attachments using media_handle_upload $attach_id = media_handle_upload ( $file_handler, null ); the I've specified ...
0
votes
2answers
2k views

How Can I pass an image file to wp_handle_upload?

I have been looking everywhere for this and havent been able to find an answer. I need to pass a file from the url source to wp_handle_upload. How can I accomplish this? Thank you
1
vote
1answer
1k views

wp_handle_upload() - how to upload to a custom subdirectory within uploads

wp_handle_upload() works for me, but uploads files where it wants (uploads/year/month). Question: Is there any way to tell it to upload files to a custom dir (uploads/mycustomdir)? Or is there some ...
1
vote
0answers
195 views

wp_handle_upload: get custom checkbox value from media uploader

I found a snippet to add a checkbox to media uploader using action post-upload-ui Snippet found here /** * Add checkbox to set autocreate on upload */ function ...
0
votes
1answer
190 views

upload file with front-end submission and forward the data in an email

I have an email set up using wp_mail that forwards my front-end submission data as well as posting it to the dashboard. The part that I am having trouble with is forwarding the attachment file with ...
3
votes
1answer
2k views

Image resize with image url

I am using wp_handle_upload() to allow users to upload the images in back-end and I want to re-size images to a custom size before uploading it. Is there any way without using any plugins or so to ...
1
vote
0answers
112 views

Frontend image uploading from frontend cant handle hebrew names

i'm using the insert_attachment code in my functions.php : function insert_attachment($file_handler,$post_id,$setthumb='false') { // check to make sure its a successful upload if ...
3
votes
1answer
432 views

Modify image while uploading

I have a plugin which uploads image using wp_upload_handler here is a function: //handles upload, a modified version of bp_core_avatar_handle_upload(from bp-core/bp-core-avatars.php) function ...
0
votes
1answer
92 views

Image upload and crop in wordpress

I am new to wordpress and buddypress plugin. I want image upload and crop functionality in a new page. How can I do this. I searched over the internet and couldn't able to find a tutorial to do this. ...
2
votes
1answer
886 views

Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”

Good morning, I am trying to change name format that Wordpress uses to rename uploaded files. As I upload an image whose filename is "desert-landscape.jpg", Wordpress will set up scaled versions and ...
0
votes
0answers
81 views

plugin: alter “crunching…” text, reject the upload, and other logic

I am new to wordpress, but a customer wants one of my scripts converted into a wordpress plugin. The basic idea of the script is when a file is uploaded with a specific filetype, then start decoding ...
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 ...
3
votes
1answer
820 views

Changing upload directory for plugin uploads only

I've spent a lot of time reading the other threads on this question, but I just cannot get my code to function properly. I'm building a plugin, and I've set up an upload form on my custom admin page, ...
0
votes
1answer
280 views

WordPress front-end media (image) upload ERROR!

I pasted my codes HERE in Pastebin. Thing is that, I have posts, where the post thumbnail is the first image and the custom fields are used to store the other 3 images of the post. The form fields ...
0
votes
1answer
497 views

Specified file failed upload test. Error When Uploading Image From Front-end

This is my code: $file_return = wp_handle_upload($_FILES['my-photo'], array('test_form' => FALSE)); if(isset($file_return['error']) || isset($file_return['upload_error_handler'])) { echo "And ...
0
votes
1answer
485 views

How to use getimagesize() of image upload?

I need to check the resolution of an image I want to upload via media box, and then upload it into a custom directory. As a starting point I used part of the code from How Can I Organize the Uploads ...
1
vote
2answers
1k views

Custom image upload

I'm trying to setup upload for for attachments for my custom post form. At first I add to my form tag enctype="multipart/form-data" For testing purposes I have two upload forms, but in future I'm ...
1
vote
0answers
403 views

Upload video in custom folder

I am trying to find a system to upload some kind of media in a custom folder. I want to keep all uploads in default wordpress folder and create a custom folder just for videos. So i would have the ...
2
votes
1answer
868 views

rename attachments based on parent-post-title on upload

I know there a some functions already avaible here for this task, but none of them seem to work as needed. The best way seems to me adding a filter to wp_handle_upload_prefilter like kaiser does in ...
0
votes
1answer
910 views

Upload an image at frontend > Create direction and/or rename filename possible?

I have a form for a non-profit-club, that publish posts + up to 20 images. The image-path will be writen in a custom-field. Images are uploaded. Ok, now i want to rename the pictures or (much better) ...
0
votes
1answer
944 views

Image upload and path to custom field

I build a script, to post from frontend. There are many custom-fields. Most works fine, but with one thing i have problems. First a description, then the script. It seems like, that images won't ...
2
votes
1answer
4k views

Rename image uploads with width in filename

I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
1
vote
1answer
601 views

Organizing uploaded media with wp_insert_post() and wp_handle_upload according to time parameter

I'm retroactively creating a post with wp_insert_post() and attaching a featuring image to it. I need the image to go into the folder that corresponds to the post's publishing date. I'm using time ...
0
votes
1answer
2k views

Using wp_handle_upload and media_handle_sideload with ajax

I'm struggling to figure out how to use wp_handle_upload() with ajax when processing a form. What I'm doing here is using a form to allow users to edit posts from the front end so they can do some ...
6
votes
2answers
3k views

How to change upload directory in wp_handle_upload

I am trying to work out how to use the wp_handle_upload function for a custom plugin so that i can specify my own own upload directory. The code so far takes a file from my plugin settings page and ...
1
vote
1answer
5k views

wp_handle_upload - The uploaded file could not be moved to wp-content/uploads/2012/09

This is the code I am using to upload the file to WordPress define(‘WP_DEBUG’, true); $filename = "test.png"; $tmpFile = download_url("http://url.com/testing/crop/".$filename); chmod($tmpFile, ...
1
vote
1answer
859 views

Upload images with comment

EDIT: I finally got the right answer; see my own answer beneath this post for everyone that's interested. After searching for a couple of days and trying over and over again I really got stuck. ...