Many times people want to upload big size media files into wordpress blog for download. Some people asked me about uploading the PDF files and video files into wordpress blog. You can easily upload big size media file to wordpress.
increase file upload size limit in wordpress
When to do wordpress installation that time default upload file limit is 2mb. Best way to increase the upload limit is adding code into .htaccess file. This file you will find in wordpress installation folder. Dont look into theme folder. Check your wordpress root folder for finding the .htaccess file.
After this you need to add the following code in to your wp-config.php file.
<tt>define('WP_MEMORY_LIMIT', '200MB');</tt>
Increase the maximum amount of a time a PHP script will run. Note: If using a shared hosting service, you may need to ask your host to increase the limit.
For you information I am giving you the information about most popular hosting providers.
Hostgator will gives the ability to increase the limit upto only 64mb.
Bluehost will gives the ability to increase the limit upto only 96mb.
Godaddy will gives the ability to increase the limit upto only 64mb.
Mostly all shared hosting providers gives you facility to upload files upto 64mb size file. If you are having any doubts then you can write to me on wordpressapi@gmail.com.
Code for File upload with meta box in wordpress using custom post type using meta boxes in wordpress. From wordpress 3.0 version wordpress introduced the custom_post_type function. Many people want to attach the file field with add_meta_box function. In this tutorial I will tell you how to upload file with custom meta box and post type. I tested above code with new wordpress versions 3.9. Still code is working fine.
Code for File upload with meta box in wordpress using custom post type using meta boxes in wordpress.
In this tutorial I will show you how to create the custom post type and add custom meta boxes to that post type and upload file with custom meta box.
After digging into wordpress files and functions I created following code. Just open your functions.php file and put following code in that file for creating custom post type.
For uploading the file through custom meta box use the following code. Following code will add the file field to custom meta box and you are able to upload file or image to wordpress and upload file attachment to you custom post. Following code is very helpful to many wordpress theme and plugin developer. If you are having any issues or trouble using code then get back to me.
For Uploading the file your post form need to add the enctype=”multipart/form-data” type to your form. Just use the following code in your functions.php file.
[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
I used the spree e-Commerce CMS for checking or R&D of Spree code. Spree is the really nice and basic tool for e-Commerce CMS.
When i was going through Spree i got to know about paperclip plugin which is used for image manipulation. Earlier i used “attachment_fu” for image manipulation and file uploading in rails projects.
How to use “Paperclip‘
First install perperclip plugin to your project.
Windows and Linux user can use my code. (I used this in WindowsXP and Fedora 9)