Join Up!
96807 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousmkdirparse_ini_filenext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | German

move_uploaded_file

(PHP 4 >= 4.0.3)

move_uploaded_file -- Moves an uploaded file to a new location

Description

bool move_uploaded_file ( string filename, string destination)

This function checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism). If the file is valid, it will be moved to the filename given by destination.

If filename is not a valid upload file, then no action will occur, and move_uploaded_file() will return FALSE.

If filename is a valid upload file, but cannot be moved for some reason, no action will occur, and move_uploaded_file() will return FALSE. Additionally, a warning will be issued.

This sort of check is especially important if there is any chance that anything done with uploaded files could reveal their contents to the user, or even to other users on the same system.

Nota: Cuando safe-mode (modo-seguro) está activado, PHP comprueba si el fichero(s)/directorios que vas a utilizar, tienen la misma UID que el script que está siendo ejecutado.

Nota: move_uploaded_file() is not affected by the normal safe-mode UID-restrictions. This is not unsafe because move_uploaded_file() only operates on files uploaded via PHP.

Aviso

If the destination file already exists, it will be overwritten.

See also is_uploaded_file(), and the section Handling file uploads for a simple usage example.

User Contributed Notes
move_uploaded_file
add a note about notes
There are no user contributed notes for this page.
previousmkdirparse_ini_filenext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST