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

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
Thank you for voting.
Rate this Materials:
Bad 
1 2 3 4 5 Excellent
print this page subscribe to newsletter subscribe to rss

Web programming � everything from the basics of visual design and architecture to the specifics of applications, graphics, and scripting. More Web Programming: Most Popular Materials | Fresh Materials | More PHP Tutorials at LearnPHP.org

Add comments to "Uploading Files With PHP"

Only registered users can write comment

Reader's comments