move_uploaded_file

move_uploaded_file

(PHP 4 >= 4.0.3, PHP 5)

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.

Note: move_uploaded_file() is both safe mode and open_basedir aware. However, restrictions are placed only on the destination path as to allow the moving of uploaded files in which filename may conflict with such restrictions. move_uploaded_file() ensures the safety of this operation by allowing only those files uploaded through PHP to be moved.

Warning

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.



Links
Bluefish $6.95/mo
  • 6GB Diskspace
  • 100GB Bandwidth
  • PHP Perl MySQL SSI CGI SSL
  • Free Domain
  • No Setup Fees
  • No Hidden Fees

iPowerWeb $7.95/mo
  • 50GB Diskspace
  • 750GB Bandwidth
  • CGI Perl PHP SSI SSL MySQL
  • Free Domain Name

AN Hosting $6.95/mo
  • 250GB Diskspace
  • 2500GB Bandwidth
  • Host 20 Domains
  • PHP RoR Python CGI SSI Unlimited MySQL DB
  • Free Domain for Life
  • 30 Day Money Back
  • 99% Uptime Guarantee

Hosting Companies


Partners


Quick Search
Platform

Price

Diskspace

Bandwidth


 Advance Search
 Show All Companies


Reference & Manual

If you are looking for dedicated servers, look no further. HostPulse.com is a site devoted to help web users find cheap web hosting and dedicated servers.


Free Sitemap Generator Host Login/Register | Contact Us | Terms | Add Links
Thumbnails by Thumbshots.org © 2002-2008 CheapHostDir.com