File Upload

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zeceer
Forum Contributor
Posts: 136
Joined: Fri Aug 02, 2002 5:10 am
Location: Norway

File Upload

Post by Zeceer »

Hi,

got his form

Code: Select all

<form method="post" action="images_add_script.php" enctype="multipart/form-data">

    <input type="file" name="image" size="25">

    <input type="submit" value="Legg til!">
    
    </form>
and this is the script

Code: Select all

@copy("$image" , "../images/uploaded/")
or die("Could not upload.");
It want upload whatever I do. For some reason :oops:
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Try looking here for some more help with file uploads:

http://www.php.net/manual/en/features.file-upload.php

You will need to do something like this

Code: Select all

<?php
$uploaddir = path/to/upload/folder;
copy($_FILES["image"]["tmp_name"], $uploaddir .$_FILES["filename"]["name"])
?>
Post Reply