I found a PHP script in the code snippets section, which said it would upload to a certain directory. The code used is below:
<?php
if($userfile) {
copy($userfile, "/images/$userfile_name"); echo "Successfully Added!<br>\n";
//$username : contains the name of TMP file, $usrfile_name : it's the real name of file
}
?>
<form action="<?php echo $PHP_SELF ?>" method="post" name="upload">
File to Upload: <input type=file name=userfile><BR>
<input type=submit value="Upload">
</form>
</body>
</html>
Everything displayed correctly, whoever when it came to uploading a file I get this error message:
Warning: copy(C:\My Documents\My Pictures\Sample.jpg) [function.copy]: failed to create stream: No such file or directory in /home/www/teenonyM/scripts/wip/upload.php on line 3
Successfully Added!
The file is quite old, so I guess there could be a PHP version problem, however is there anything else I can change?
Note: To be on the safe side I've tried chModding both the script and the images directory to 777.