PHP is open source scripting language. It\'s widely used to develop web applications.  Home Web Programming PHP Uploading Files With PHP

Uploading Files With PHP


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!



Author's URL: Arnab_Ghosh
PHP is open source scripting language. It\'s widely used to develop web applications. More PHP Tutorials: Featured Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

No comments yet...
Add comments to "Uploading Files With PHP"

Captcha