How to upload and retrieve pdf file in php in dreamweaver

I want to know how to upload and retrieve pdf file in php in dreamweaver cs3

Now I’m use php 5 and mysql.
Anyone can show me the method upload and retrieve pdf file

To avoid confusion, we don’t need to know your editor. Code is code, you could use Notepad if you wanted to. (You could, but don’t.) For a moment there, I thought you were talking about setting up FTP with Dreamweaver.

Now, what you need to do is create a page with a form equipped for file uploads. That’s form is going to look something like this:

<form enctype="multipart/form-data" action="uploader.php" method="POST">
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />

That file will be uploaded to your temp directory on the forms submission and you can access the uploaded file through the $_FILES array.

In the PHP script called uploader.php you want to do a few things. First among them, decide where to move the uploaded file. For this, you want to gt the files original name, which will be included in $_FILES[‘uploadedfile’][‘name’]. To get just the filename, call basename() on it.

// Where the file is going to be placed 
$target_path = "uploads/";

/* Add the original filename to our target path.  
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

Now that you’ve got a file and a destination, you want to move the file somewhere permanent.

You can do that with move_uploaded_file(). You’ll aslo need the files temp name, given to it when it was uploaded to your server. You’ll find it in $_FILES[‘uploadedfile’][‘tmp_name’]. Pass the temp name and the target name to the function and you’re done. Keep in mind that the target folder must already exist before you can move a file to it.

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";

That is the most basic of file uploaders. You’re going to want to place checks in it to make sure people aren’t uploading files you don’t want. First and foremost, check the file extension and make sure it’s PDF. Then check mime types, size restrictions, and so on. I’ll leave that stuff up to you, this is just the bare bones of file uploading.
I hope it helps!