I need to know if there is any other function that can do this.
I was trying to create a function that will upload photo to the wp_handle_upload()
Now what im trying to search is that. Is it possible that while going to this function the photo will rename.
if ( ! function_exists( 'wp_handle_upload' ) ) require_once( ABSPATH . 'wp-admin/includes/file.php' );
$uploadphoto = $_FILES['image'];
$uploadphoto_overrides = array( 'test_form' => false );
$movephoto = wp_handle_upload( $uploadphoto, $uploadphoto_overrides );
im trying to do something like this
$uploadphoto = '123changename' . $_FILES['image'];
I only got errors. Is there other way?
Use this: $uploadphoto = time() . '_my_file_' . $_FILES['image'];
where $_FILES['image']
is an array. If you want to store the name use:
$uploadphoto_name = time() . '_my_file_' . $_FILES['image'][0];