I solved it by using basically the same code, but seperate the upload code to an individual php-file.
It’s not as beautiful as it could be but it works.
Related Posts:
- “Add Media” button in custom plugin
- Allow all file types for upload
- Remote upload file to server B
- What plugin can I use to create a list / slideshow of featured images?
- Upload specific images to specific folder
- Any plugin out there that uses WP’s internal image uploader?
- How to upload image with simple form?
- Way to force media uploader use custom image size
- How to make WordPress use protocol indepentent upload files?
- how does wp.media javascript library work?
- How to create an edit media button for slideshow plugin?
- Please select a file error
- Use Media Uploader in Plugin
- How can I add a custom meta value on file upload?
- How to upload thousands of images?
- Extending WP’s upload/insert media functionality
- Deleting images through upload folder, but not deleting from media library
- Generated Images sizes do not match Media Settings Image Size
- How can I use a video header that’s over 8MB?
- Saving/Writing/Adding file to upload folder
- How can I process xml file on upload?
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- How to import 55k images (uploaded via FTP) into WordPress Media libary? [closed]
- AJAX image upload with a upload progress bar using media_handle_upload
- Is it possible to personalize the Media Library?
- Changing image URLs in media library
- Bulk Image Uploader to create new post from each image [closed]
- Upload file inside plugins options page
- Adding Attachment Display Settings in custom media frame
- Find unused images?
- Plugin upload to install
- Media upload not working on theme option in WordPress 3.8.1
- Why does my functions.php cause white-screen and media-library issues?
- Image upload and other options in the same plugin settings form?
- How organize uploaded media in WP?
- How to find the origin of a file upload from within wp_handle_upload?
- Plugin or method to delete uploads not in media library?
- How to change File URL in file uploaded to s3 compatible storage with self written plugin [closed]
- Restrict media upload size by format
- wp_generate_attachment_metadata is creating an empty array
- Removing included CSS file that doesn’t exist
- Submit page limited in time to upload image
- wp.media javascript issue with on select
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Auto move media file to cloud
- transfer a file from one domain to another via wp
- Add custom JavaScript that is a combination of CDN/uploaded files and easily-edited code?
- media page returnig to 404 in rtmedia [closed]
- Media Upload Tab reload and change $_GET
- Plugin Not Working After Being Uploaded To WordPress Plugin Repository
- Bulk Image Upload And Rerrange Functionality
- Redirect to another page using contact form 7? [closed]
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- How to change the wp_upload_dir() path in plugin
- Use wp_upload_dir() correctly
- Measure and limit file uploads
- adding a button to the media uploader
- Is there a function to list all uploaded images? How can I add one?
- custom uploader in the admin area
- Allowing .rfa Files In Media Upload [duplicate]
- Programatically upload a file to be stored inside blob field in database, NOT on filesystem
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- download button for audio file in post [closed]
- Large amount image data transfer
- File Uploader – Upload without adding to Media Library
- How programatically cause uploads folder to be created?
- Issue with wp_handle_upload
- Detect plugin/theme installation (via upload)
- Add a file upload field
- How To Create A File Archive in WordPress?
- WordPress does not allow me to upload a .xml file
- Simple sildeshow/image-upload plugin?
- WordPress not showing manually uploaded files in Uploads folder on Media Library
- How to upload large media file in chunks, without any plugin?
- Upload PlugIn Button is missing
- How to copy the all WordPress media items to another custom plugin folder?
- HTTP Error upload ( localhost )
- Is there a way to auto generate poster image for videos
- Access remote SFTP server via WordPress login?
- how to split and upload a theme on wordpress?
- How to Upload images to a custom folder in upload folder using media uploader
- Is it possible to pull all featured images from WP database only?
- include plugin folder directly in theme folder to load faster page n wp
- Is there a WP-Plugin to convert PNG to GIF? [closed]
- Upload Image to desired directory through plugin
- I want to disable certain file types from upload from dokan description field
- How to rename files during upload to a random string?
- how to get the url of a custom uploaded file
- A way to upload old html pages with all its assets via WordPress admin and to add a fixed menu on top of those (a la Wayback Machine)
- wp_handle_upload – specified file failed upload test
- Uploading a plugin as .zip
- Increased max_upload_filesize, but still can’t upload plugin [closed]
- How to connect WordPress media to another host?
- Upload the images folder with sub-folders directly to server
- upload_mimes is getting ingored, how to add a new mime type?
- How To Convert External Image URLs To Own Website’s Uploaded Images Automatically?
- I want to allow certain file types on dokan upload files
- stop resize button for wordpress media
- Custom uploader – Upload files and save link into database
- media_sideload_image only works on localhost and without return id or src