$name apparently contains a URL. That won’t work. Set it to a local path, as you did with $filename:
$upload_dir = wp_upload_dir();
$filename = $upload_dir["basedir"] . '/deals/deal' . $page->id . '.pdf';
Related Posts:
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- wp_temp_dir does not change the /tmp temporary default directory
- Change default uploads file using wp Skeleton
- Adding Adobe files to a wordpress site [closed]
- Placing assets for external use
- WordPress HTTP Error on File upload
- Interface for logged-in users to upload/download files
- Right way to download file from source to destination
- Uploaded images result in a file url with full path on disk appended
- Where to store sensitive uploaded file?
- Creating an .ics calendar subscription service with wordpress
- Private file system for attachments
- Extend Media Library
- How to make “Upload files”selected by default in Insert Media?
- Upload post thumbnail from the front end
- How are the year and month folders added to the uploads directory?
- Where does wordpress store the FTP credentials?
- wp_generate_attachment_metadata returns empty array
- Password protect some uploaded files, so only logged-in users can view them
- Change URLs for static content
- How to save media files under “http://example.com/custom_folder” for a specific page
- Post type specific upload folder in 3.5
- How to get profile user id when uploading image via media uploader on profile page
- View content from uploaded file in editor
- Media upload – choose only one file
- Add suffix to filename of uploaded images
- WordPress cannot upload data after migration
- How to rewrite WordPress uploads folder to another folder using htaccess
- Can’t seem to upload a file to a custom directory
- wp.media add context
- Conditional add_filter for upload directory?
- Need to download uploaded binary file
- Insert Image automatically when upload finishes wordpress media uploader
- How do I modify the url of uploaded media content?
- WordPress “HTTP error.” when uploading Media – IIS
- Limit upload file type on one custom post type
- Uploading images on front end doesn’t generate thumbnail sizes
- Adding Media Upload to Custom Options Panel breaks “Insert into Post”
- WordPress bug with capabilities?
- media_handle_upload() progress bar
- Manipulate CSV data during upload, is it possible?
- How to submit data between wp_iframe and backbone.js in media upload
- What are best practices to storing uploads in WordPress?
- Symbolic link for uploads in wordpress
- Process uploads with phpThumb before generating thumbnails
- Resize existing library images
- WP 4.3.1 new install on localhost missing php.ini [closed]
- Large image upload size (using timthumb.php
- How would I change the 10 MB limit to 5 GB in this script?
- When does WP resize an image file
- How does wordpress handle media files?
- Upload Custom Mime Types in WordPress (SVG, WebP)
- Can upload through FTP but not through WP uploader
- upload_max_size doesn’t change
- Upload and attach to a post multiple image files [closed]
- WordPress upload file action hook
- Batch upload to create posts each with one image, headline, and body text
- Control resizing of uploaded images
- How to add an upload image button (just like the one in the Custom Header) in the Theme Options I just created?
- protect files from downloading on other than my site
- WordPress File Upload Form Returning Null
- How to add CSV upload functionality on the edit page of a Custom Post Type
- WordPress changing media file name upon upload
- How to remove media by filename?
- Restrict Users to Only Edit Media Owned by Users in Their Role
- media_handle_upload() returns Specified file failed upload test
- How to upload a file and have it available on the post for download?
- WP media upload issues
- Increase .htaccess file upload without prompting error
- Images uploaded via Gutenberg image block are cropped
- WordPress upload folder stuck in 2017
- Media uploads error
- Add file upload with validation to custom form
- How can i link my featured image to be clicked and the file will be downloaded
- Nginx – WordPress Upload only images rule
- How to get images to show in Media when saved Via PHP
- wp.media – media uploader – how to destroy instance of modal?
- Add a image uploader in the posts page backend
- Uploaded image doesn’t show up in media library
- Using media-upload.php – requires user to have edit_posts capability?
- 2 years old website can’t upload and can’t update since today
- Issues with WordPress 3.9.6 media libraries on XAMPP
- WordPress problem uploading new media : File is empty. Please upload something more substantial
- limit the access to uploaded files
- Used Duplicator to transfer a site. Now my media uploads aren’t working
- Insert into post or
- Metabox with file upload to custom directory
- How to force attachment size for every post
- Is it possible to upload multiple images via Media Library tab in Thickbox I’ve created?
- How to upload an image using media uploader and return the image link to javascript?
- Frontend file upload works, but I get error “Constant ABSPATH already defined”
- Link or button to open the media manager from frontend
- Attach unzipped files to wordpress
- Unable to create directory
- Rename upload images during upload
- Bring up the media uploader on click
- How to load file only in single post page through function.php?
- Simplifying ‘Add Media’ Modal in front-end Content Editor
- Front end form with images and media_handle_upload logic?
- wp-content/uploads/year/month returns 404