Hallo One2xs,
Ik was weer bezig met PHP.
Nou ja, ik volgde een tutorial van PHPAcademy op Youtube.
Ik had een script nodig en ik schreef alles netjes over, Maar ik weet niet hoe het moet ik krijg steeds deze errors:
Warning: move_uploaded_file(data/thumbs/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/kqownzkq/domains/animefan.nl/public_html/ingelogd/manga/upload.php on line 14
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move /tmp/php7hcHPW to data/thumbs/ in /home/kqownzkq/domains/animefan.nl/public_html/ingelogd/manga/upload.php on line 14
Wat wil ik?
Ik wil dat je met 1 file te uploaden het meteen in 2 verschillende folders (mappen) word geplaatst.
Het mag alleen een foto zijn, geen movie, php file, enz..
Wat ik nu heb:
Skytop
Ik was weer bezig met PHP.

Nou ja, ik volgde een tutorial van PHPAcademy op Youtube.
Ik had een script nodig en ik schreef alles netjes over, Maar ik weet niet hoe het moet ik krijg steeds deze errors:
Warning: move_uploaded_file(data/thumbs/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home/kqownzkq/domains/animefan.nl/public_html/ingelogd/manga/upload.php on line 14
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move /tmp/php7hcHPW to data/thumbs/ in /home/kqownzkq/domains/animefan.nl/public_html/ingelogd/manga/upload.php on line 14
Wat wil ik?
Ik wil dat je met 1 file te uploaden het meteen in 2 verschillende folders (mappen) word geplaatst.
Het mag alleen een foto zijn, geen movie, php file, enz..
Wat ik nu heb:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();[/COLOR]
[COLOR= #0000BB]$file_name[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]images[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$file_size[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]size[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$file_tmp[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]image[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tmp_name[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$file_size[/COLOR] [COLOR= #007700]>[/COLOR] [COLOR= #0000BB]2097152[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$errors[/COLOR][COLOR= #007700][] =[/COLOR] [COLOR= #DD0000]"File size must be under 2 Megabytes."[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR][COLOR= #007700])) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/move_uploaded_file"]move_uploaded_file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$file_tmp[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]data/thumbs/[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$file_name[/COLOR][COLOR= #007700])){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"File Uploaded in <b>THUMBS</b>, click <a href=upload2.php>here</a> for upload it in folder Album to display the image.s"[/COLOR][COLOR= #007700];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL]
[URL="http://www.php.net/foreach"]foreach[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$errors[/COLOR] [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$error[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]<br />[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>
<form action="" method="POST" enctype="multipart/form-data">
<p>
<input type="file" name="image" />
<input type="submit" value="Upload" />
</p>
</form> Skytop