upload download (file system) (tag)

download_url()

Uploads a file (URL) to a temporary PHP directory. Works based on the WordPress HTTP API.

media_handle_sideload()

Uploads a file to the WordPress media library from the provided array with file data, similar to media_handle_upload().

media_handle_upload()

Uploads the file provided in the form to the WordPress uploads folder and creates a record of the file in the database (adds the file to the WP media library).

media_sideload_image()

Uploads an image to the WP media library from the specified URL and attaches it to a post.

size_format()

Converts bytes to a human-readable format: 500 B, 63 KB, 9 MB, 2 GB, 1 TB.

wp_check_filetype()

Gets the file extension and MIME type by the given filename (path). Used to check whether the specified file type is allowed to be uploaded to the site.

wp_check_filetype_and_ext()

Checks if the specified file is allowed to be uploaded based on its actual MIME type.

wp_convert_hr_to_bytes()

Converts a shortened byte value to an integer byte value. For example, the string 1Mb will be converted to the number 1048576.

wp_font_dir()

Gets the path and URL of the current fonts folder.

wp_get_upload_dir()

Retrieves data about the uploads folder (upload) as an array of parameters.

wp_handle_sideload()

Moves a temporary file to the uploads folder.

wp_handle_upload()

Processes file upload via $_FILES. Checks the file and moves it to the UPLOADS folder.

wp_max_upload_size()

Gets the maximum file size (in bytes) that is allowed to be uploaded in WordPress.

wp_upload_bits()

Creates a file with the specified content in the uploads folder (upload). Returns the uploaded file data. Does not store file data in the DB.