niestety mam jeszcze jeden mały problem, gdy zrobiłem uploadowanie kilku plików naraz w ten sposób:
Kod
<?php
echo '
<meta http-equiv="content-type" content="text/html; charset=windows-1250" />';
if(isset($_POST['send'])) {
$uchwyt = fopen($_FILES['userfile']['tmp_name'], 'r');
$uchwyt2 = fopen($_FILES['userfile2']['tmp_name'], 'r');
$uchwyt3 = fopen($_FILES['userfile3']['tmp_name'], 'r');
$uchwyt4 = fopen($_FILES['userfile4']['tmp_name'], 'r');
$uchwyt5 = fopen($_FILES['userfile5']['tmp_name'], 'r');
$uchwyt6 = fopen($_FILES['userfile6']['tmp_name'], 'r');
$uchwyt7 = fopen($_FILES['userfile7']['tmp_name'], 'r');
$uchwyt8 = fopen($_FILES['userfile8']['tmp_name'], 'r');
$uchwyt9 = fopen($_FILES['userfile9']['tmp_name'], 'r');
$msg .= fread($uchwyt, filesize($_FILES['userfile']['tmp_name']));
$msg .= fread($uchwyt2, filesize($_FILES['userfile2']['tmp_name']));
$msg .= fread($uchwyt3, filesize($_FILES['userfile3']['tmp_name']));
$msg .= fread($uchwyt4, filesize($_FILES['userfile4']['tmp_name']));
$msg .= fread($uchwyt5, filesize($_FILES['userfile5']['tmp_name']));
$msg .= fread($uchwyt6, filesize($_FILES['userfile6']['tmp_name']));
$msg .= fread($uchwyt7, filesize($_FILES['userfile7']['tmp_name']));
$msg .= fread($uchwyt8, filesize($_FILES['userfile8']['tmp_name']));
$msg .= fread($uchwyt9, filesize($_FILES['userfile9']['tmp_name']));
echo "<br><br>".nl2br($msg);
}else {
echo '
<form enctype="multipart/form-data" action="" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Pliki do wysłania: <br>
<input name="userfile" type="file" /><br>
<input name="userfile2" type="file" /><br>
<input name="userfile3" type="file" /><br>
<input name="userfile4" type="file" /><br>
<input name="userfile5" type="file" /><br>
<input name="userfile6" type="file" /><br>
<input name="userfile7" type="file" /><br>
<input name="userfile8" type="file" /><br>
<input name="userfile9" type="file" /><br>
<input type="submit" value="Wyślij" name="send" />
</form>
';
}
?>
pliki są wgrywane poprawnie jeden pod drugim, więc dlaczego na górze wyskakują mi błędy:
Kod
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/localhost/httpdocs/file.php[/b] on line [b]19[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]20[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]21[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]22[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]23[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]24[/b]
[b]Warning[/b]: fread(): supplied argument is not a valid stream resource in [b]/srv/www/vhosts/[/b][b]localhost[/b][b]/httpdocs/file.php[/b] on line [b]25[/b]
skrypt działa ale te błędy..