WordPress.org

Ready to get started?Download WordPress

Codex

Function Reference/wp handle sideload

This page is marked as incomplete. You can help Codex by expanding it.

Contents

Description

Handle sideloads, which is the process of retrieving a media item from another server instead of a traditional media upload. This process involves sanitizing the filename, checking extensions for mime type, and moving the file to the appropriate directory within the uploads directory.

Usage

<?php wp_handle_sideload( &$file$overrides$time ); ?>

Parameters

$file
(array) (required) an array similar to that of a PHP $_FILES POST array
Default: None
$overrides
(array) (optional) An associative array of names => values to override default variables with extract( $overrides, EXTR_OVERWRITE ).
Default: false
$time
(string) (optional) Time formatted in 'yyyy/mm'.
Default: null

Return Values

(array) 
On success, returns an associative array of file attributes. On failure, returns the return of the upload error handler, which by default would be array( 'error' => $message ).

Examples

Notes

Change Log

Since: 2.6.0

Source File

wp_handle_sideload() is located in wp-admin/includes/file.php

Related

Upload Functions: media_handle_upload(), media_handle_sideload(), wp_handle_upload(), wp_import_handle_upload(), wp_handle_sideload(), media_sideload_image()

See also index of Function Reference and index of Template Tags.