Vectorials
Flash Perfection
3D Lessons
Tutorialkit
Markup Tutorials
Learn PHP
network
adv banner
Web Programming  Home Web Programming PHP Uploading Files With PHP
rss

Uploading Files With PHP

Author: Arnab_Ghosh More by this author


Uploading Files With PHPUpload an image or file to your server without using your FTP.

Step 1: Open a web editor, then paste this

<form action="upload.php" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="file" size="30"> <input type="submit" value="Upload!">
</form>

Then save it as form.php

Step 2: Open a web editor once again, and paste this code:

<?php
$uploaddir = "uploads"; // Where you want the files to upload to
if(is_uploaded_file($_FILES['file']['tmp_name']))
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
}
print "Your file has been uploaded successfully!";
?>

Save it as upload.php

Step 3: Upload these to files onto your website using any ftp program.

Step 4: Upload a folder called uploads and CHMOD it to 0777

Your Done!



Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Uploading Files With PHP"