This won't upload to the specified directory, why is that?
It's actually sending it to a temp location.Code:<?php if (array_key_exists('upload', $_POST)) { // define constant for upload folder define('UPLOAD_DIR', 'C:\Program Files\EasyPHP-5.3.2i\www\uploads'); // move the file to the upload folder and rename it move_uploaded_file($_FILES['image']['tmp_name'], UPLOAD_DIR.$_FILES['image']['name']); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <form action="" method="post" enctype="multipart/form-data" ? name="uploadImage" id="uploadImage"> <p> <label for="image">Upload image:</label> <input type="file" name="image" id="image" /> </p> <p> <input type="submit" name="upload" id="upload" value="Upload" /> </p> </form> <pre> <?php if (array_key_exists('upload', $_POST)) { print_r($_FILES); } ?> </pre> </body> </html>
C:\Program Files\EasyPHP-5.3.2i\tmp\php7641.tmp
Results 1 to 1 of 1
Thread: moar of the good stuff.
- 19 Jun. 2010 03:07pm #1
moar of the good stuff.