June 7, 200818 yr hello again any chance you can point me in the right direction with this script <?php if($_POST[upload] == "1") { $to = "uploads/".$_FILES['file']['name']; move_uploaded_file($_FILES['file']['tmp_name'], $to); echo "uploaded"; } ?> <form method = "post" enctype="multipart/form-data"> <input name="upload" type="hidden" value="1" > <input name="file" type="file" > <input name="button" type="submit" value = "upload"> </form> when i try it on my testing server i get the following Warning: move_uploaded_file(uploads/index.php) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\wamp\www\test.php on line 5 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpD3.tmp' to 'uploads/index.php' in C:\wamp\www\test.php on line 5 uploaded so i guess i have to create a file in my www directry called ? but if it was live on my site would it have to have a file extension #am a bit confused it doesnt take much these days thanks
June 7, 200818 yr Author i have got it to work there i had put a spelling mistake in the file name on my www directory, now i have this working how do i use it to put a jpg to my server thanks
Create an account or sign in to comment