Implementing your own upload form like this can be a major security vulnerability, you might want to instead use a library/script where such potential issues are already dealt with properly.
Here is one I remember using successfully on a project for a similar purpose (user uploaded video)… though it may be more than what you need, it does have more examples and documentation than a simplified web example:
PL Upload
EDIT: I just remembered that was actually my fallback uploader for that project, the main one used was ResumeableJS as it supports file resuming for large files (very handy for video uploads!)
Related Posts:
- add_filter the_content str_replace after shortcode
- Custom image upload
- My form action url is being prepended with a directory that does not exists
- How to store data from multiple forms using ajax and php
- Why Won’t My Inputs in a form with a Get method work together?
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Search WordPress using static html page
- How to execute html code inside php?
- How to add post meta in while loop?
- File Uploader – Upload without adding to Media Library
- Adding attribute to the post.php form tag in wp-admin
- Front end file upload returning wrong attachment url
- WordPressUser Submission Form
- Custom forms with HTML
- Cascading dropdown select search based on Parent Page & Child Page
- HTML Form Question
- wordpress form action page not found
- Custom HTML form using PHP – help with ajax/username validation
- Correct Syntax for uploading files to custom directory in WordPress
- How can we upload custom page files?
- How can I process a form submission from an HTTP POST request?
- Custom profile field with birthday. Troubles with
- Using the echo command adds unwanted br tags to source
- custom fields wordpress
- Why the JavaScript code is ignored from wp editor?
- How can I reuse the code to capture a param in a URL and place in a value in a hidden form?
- Populate dropdown with Child Pages based on Parent Page chosen
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to use $query->set with post__in?
- search and replace preword from author
- Embed html in php code
- PDF file randomly breaks upon upload
- Ajax loaded form replaces form action with Ajax url
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- How to limit the number of forgot password reset attempts in WordPress?
- Custom search results page not working with empty search
- WP grandchild categories in nested ul li
- Modify HTML structure of fields in woocommerce checkout form
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- How to upload a file to a folder named after the user_id via plugin
- Use DOMDocument with ob_start breaks my HTML code
- Need help with Google drive API [closed]
- How to change redirection route to a php page for making it only accessible by logged-in members?
- Can’t upload image using media_sideload_image
- selected option if current category is the value
- Upload multiple images to a Woocomerce product
- Post + form + action + results on the same page
- Ajax call return 404
- How to remove ?wp-mce-4103-20162941
- Customize position of social icons in upme plugin [closed]
- How to pre populate a form field with a link of a current user’s author profile?
- What is the alternative to “ when it comes to calling Media (image) files in the ‘attachment.php’ file?
- parts of url disappear when using # inside href=”” [closed]
- Settings API callback function inserts html quotes from nowhere
- Upload file could not be moved to wp-content/uploads
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Enable custom logo upload if logo is not in header
- NGINX rewrite rules for multisite
- Different post styles depending on category
- How create a Shortcode with hover and complex options
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- Dot is not added at the end of href
- WordPress Multiple Navigation bars
- Position banner to right of logo in header – messed up my header file
- Commenting out unwated CSS/scripts in HTML with PHP
- Attach previously uploaded image to post – current code has unexpected results
- Show success or error messages in Ajax response to WordPress custom registration form
- Styling my own password protected page, how to deal with wrong password?
- Contact form won’t submit
- How do I get around “Sorry, this file type is not permitted for security reasons”?
- wp_mail file attachment not being placed in upload folder?
- How to separate HTML and WordPress files
- Add .htm extention to a custom taxonomy
- Search Query: how to construct a search string from two select elements?
- Auto 301 to full post permalink? (using : /archive/%post_id% to %post_name% )
- Databases – Submitting data from inputs to database [closed]
- How to show a ‘correct’ message after submit a form?
- Change WordPress Upload Folder using wp handle upload
- How do I add a custom css to all posts without affecting homepage css? [closed]
- db converts decimal number wrong
- Form Security: nonce vs. jQuery
- How do I Import / Upload Files with jQuery AJAX?
- Make PHP work with HTML tags
- WordPress admin-ajax.php 400 bad request
- WordPress automatically adds links to uploaded images
- WordPress function when file is uploaded, deleted or edited
- Noscript not working as it should in wordpress site
- Show latest posts in a plain HTML website custom widget [closed]
- How to convert select to HTML with PHP tags inside of it [closed]
- Is this spyware on my site or a real Java update?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- Ajax contact form return 0
- Can I get an email notification when media is uploaded to the media library?
- Trying do build a contact form
- How to make modifications only to certain elements of an HTML string on the server-side?
- “operation successful” message
- Wrapping a Sidebar within
- User register hook is not working in woocomerce register form