Saturday, May 8, 2010

PHP file upload

To store files in project no need to store whole file in database just upload that file on server and store only location (path) of that file in the database

To upload file on server and store it on particular path code is :






<form method="POST" action="sub.php" enctype="multipart/form-data">

<input type="file" name="fileup">

<input type="submit" name="abc">








echo "File uploaded ";



on other side you have to use $_FILE[] it s two dimension array

when you upload any file to server apache store it on temp location i.e. ‘($_FILES['fileup']['tmp_name']’ from their you can move that file on any location using

‘move_uploaded_file()’ function

No comments:

Post a Comment