0
votes
1answer
221 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
49 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
124 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 ...
0
votes
0answers
29 views

What kind of security does wp_handle_upload() provide?

According to the docs, wp_handle_upload(), will: Handle PHP uploads in WordPress, sanitizing file names, checking extensions for mime type, and moving the file to the appropriate directory within ...
0
votes
0answers
42 views

Wordpress CPT Upload Audio Files to wp-content/upload/audio

I'm working on a custom post type for my blog that will read files in the directory specified and create a post for that file. I also want to use the wp upload handler in my custom post type but I ...
0
votes
1answer
91 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 ...
1
vote
0answers
66 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
205 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
67 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. ...
0
votes
0answers
52 views

custom Image upload coding wordpress

Hello im working on WordPress plugin with separate data tables in same database. so far im doing okay with add new post. I want to add images to my post. I tried many things but so far I've got ...
1
vote
1answer
340 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
71 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
724 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
470 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
206 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
231 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
663 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 ...
0
votes
1answer
606 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
492 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
2k 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 ...
0
votes
1answer
868 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 ...
1
vote
1answer
3k 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, ...
2
votes
2answers
2k views

How to set file type in wp_handle_upload?

I'm using wp_handle_upload to allow users upload .csv files in the front end and it's working fine. I was wondering how can I limit this to only allow .csv files though since currently it accepts a ...