Untested but I am pretty sure this is the issue:
You are trying to attach $uploadedfile
to the email. You’ve set $uploadedfile
to $_FILES['file']
. That is a very temporary file/file location.
Once you use wp_handle_upload
you want to be using $movefile
instead. If you look at the Codex entry for that function you can see that you need (probably) $movefile['file'])
Related Posts:
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- simple solution for restricting access to (some) uploads/downloads
- Send attachments via wp_mail from temporary folder
- Saving images from Gravity Forms repeatable File Upload as post attachments [closed]
- How to get all files inserted (but not attached) to a post
- Password protect some uploaded files, so only logged-in users can view them
- How to check if an image attachment exists before uploading
- Add suffix to filename of uploaded images
- Check if image exists before uploading with media_sideload_image()
- Add a YouTube or Vimeo video as a post attachment?
- How can I save the original filename to the database?
- ACF attachment custom field in rest response
- How to solve: An error occured in the upload
- How to send email in wordpress with more than one attachments
- Images not being generated at correct size
- How to manage a big collection of files with wordpress?
- Use the WP media uploader dialog for uploading a form attachment (non-admin). Offering progress and drag and drop feedback
- Email Attachment from Form Submit
- Rename attachment filenames to attachment ID on upload
- What is the way to add additional fields to attachments in 3.5+?
- How to edit attachment with media-upload.php?
- Upload iPhone video clips to blog via native WP app
- How to load attachment in media library for current user?
- How does WordPress decides how many sizes of an image to create?
- Upload and attach to a post multiple image files [closed]
- wp_generate_attachment_metadata for non-images files
- How to add filetype to meta value when using wp_upload_bits?
- Insert attachments from custom uploader into post (regular uploader style)
- PDF Upload from Input Error
- Do custom post type (CPT) attachments/media store the parent post ID?
- Using unzip_file() to get contents of file
- What is wrong with my wp_insert_attachment code?
- Adding attachment custom field metadata to TinyMCE tag
- Updating the attachment from front end doesn’t show the new change
- Set attachment category from file name on upload
- “Could not write file” error in wp_upload_bits function
- _d_improd_ directory in uploads breaking site images
- Check if author or uploader id of the attachment(uploaded) image is match?
- Limit attachment caption characters
- controlling whether upload is attached to post or not
- How to force attachment size for every post
- Attachment Metadata not updated while uploading audio files
- Upload file to front-end form and send as email attachment
- Limit number of uploaded attachments of specific context
- How do I protect my uploads?
- How do I update attachment urls after changing site domain
- How to properly move media files and update data?
- How to show all available images in WP’s media library when using the Polylang plugin?
- Saving Media – Which Hook is Fired?
- How to restrict access to uploaded files?
- retrieve custom image sizes from media uploader javascript object
- Is it possible to allow zip files to be uploaded in WordPress?
- WordPress monthly upload directory owner set to root
- Set a maximum upload count for users on a specific user role
- Importing WordPress Attachments Into Custom Directories In wp-content/uploads/
- add_image_size creating lots of images (of various sizes)
- This file type is not allowed. Please try another
- Accessing Media/Files outside the_content
- Media uploader not work properly [closed]
- “HTTP error” randomly on image uploads
- WordPress cannot upload data after migration
- Bug when uploading pictures with international characters?
- How To install AWS SDK for PHP in wordpress?
- Add fields to the WordPress media uploader
- How to retrieve alt attribute for an attachment (uploaded image)?
- How to remove some media upload icons from post editor?
- How to upload unknown file type?
- Upload file without attaching it to a POST
- The uploaded file exceeds the upload_max_filesize directive in php.ini
- remove_accents does not seem to work (when used inside sanitize_file_name filter)
- move_uploaded_file() not working on wordpress front end
- wrong media url in wordpress
- How to upload a file from WP directory automatically?
- How to get the return value of wp.media({ frame: ‘post’ }) in all cases?
- WordPress Uploads Directory not using dates in links
- Hide images from anonymous user?
- cannot upload anything into wordpress
- Limit image upload
- Is there any good way to use SVN for uploads directory?
- Multi Upload In Theme Options
- Uploading PDF file and providing download links to them
- Maximum post size?
- tb_show not showing a media upload window . custom plugin
- In the media Rest API, what is “missing_image_sizes”?
- Storing WordPress Media Library Uploaded files onto a separate domain
- Is there a way a user/member can upload a file and link it in his profile page?
- Resize uploaded original images to a minimum automatically
- Better solution for managing media attachments with `wp_editor()`?
- Custom Text in Media Uploader in a Theme Options Page
- Frontend AJAX Media Upload returning 404
- File was uploaded, but it is not shown on media section of the dashboard
- Moving wp-content folder to public_html
- An error occurred in the upload. Please try again later
- Featured image to grayscale with PHP imagefilter – which hook to use?
- After I upload a file to library its name converted to dashes
- Force relative path in media library for LAN deployment
- Make thumbnail from uploaded image without plugin
- Making Site A Use Site B’s wp-content Folder
- Image in binary in the data to WordPress media library
- wp_mail attachment not working in wordpress