Upload file into WordPress


if ( ! function_exists( ‘wp_handle_upload’ ) )
require_once( ABSPATH . ‘wp-admin/includes/file.php’ );

$uploadedfile = $_FILES[‘resume’];
$upload_overrides = array( ‘test_form’ => false );
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides );
if ( $movefile ) {

echo $movefile[‘url’];
echo ‘Success’;
}else{
echo ‘Fail’;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s