I'm creating a website for my teacher who doesn't know anything about ye old Internet, and to make the process easier for her, I made an admin page where she could upload files to the website.
To do this, I created a form that sends the uploaded form to a script called changes.php. Part of the script is as follows:
Previously in the code, $directory had been defined as the folder in which the file should go, depending on the file type (Like .txt or .ppt, not using filetype()), and unidentified file types being shuffled into an "other" folder.
However, when I try to run the code, I get this:
I can't figure out what is wrong, and I'm looking for some help. I stuck pretty close to the example in PHP 5 for Dummies (Which is why I bothered defining $temporary as it's own variable), but I still can't get it to work. Any ideas?
Thanks.
To do this, I created a form that sends the uploaded form to a script called changes.php. Part of the script is as follows:
| Code: |
| $path = $directory."/".$FILES[newFile][name];
$temporary = $_FILES[newFile][tmp_name]; move_uploaded_file($temporary,$path); |
Previously in the code, $directory had been defined as the folder in which the file should go, depending on the file type (Like .txt or .ppt, not using filetype()), and unidentified file types being shuffled into an "other" folder.
However, when I try to run the code, I get this:
| Quote: |
| Warning: move_uploaded_file(/): failed to open stream: Is a directory in /home/patthegr/public_html/poist/changes.php on line 64
Warning: move_uploaded_file(): Unable to move '/tmp/phpeT726H' to '/' in /home/patthegr/public_html/poist/changes.php on line 64 |
I can't figure out what is wrong, and I'm looking for some help. I stuck pretty close to the example in PHP 5 for Dummies (Which is why I bothered defining $temporary as it's own variable), but I still can't get it to work. Any ideas?
Thanks.
