Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2007, 01:19 AM
Registered User
 
Join Date: Aug 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default uploading files

please send me a simple codes about uploading files

 
Old November 28th, 2007, 02:30 PM
Registered User
 
Join Date: Nov 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
<?
$path = "uploads/";

$path = $path . basename( $_FILES['uploadedfile']['name']); 

move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$target_path); 
?>

<form enctype="multipart/form-data"  method="POST">
File: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
it's a simple example

the directory "uploads" must exist
and must have 777 permissions
so the script can store files in it


---------------
Canon PowerShot SD1000
http://astore.amazon.com/powershot08-20






Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading files rj1406 ASP.NET 1.0 and 1.1 Basics 1 October 11th, 2004 10:27 AM
Uploading Files sami PHP How-To 7 April 16th, 2004 02:29 PM
Uploading files mildge Beginning PHP 6 December 1st, 2003 12:42 PM
uploading files by c# rborsatti C# 2 September 29th, 2003 03:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.