PHP posta eklerini gönderme

0 Cevap php
<input type="file" name="uploaded_file" />

Ben posta eklerini ekleme hakkında post bulundu. Soru şu fonksiyonu ile yüklenen dosya bağlamak nasıl? Ben geçmek ne var?


UPD:

echo '<pre>';
print_r($_FILES);
echo '</pre>';

$uploads_dir = '/uploads'; // It has need rights

$tmp_name = $_FILES["vac_file"]["tmp_name"];
$res = is_uploaded_file($tmp_name); // This is true
$name = $_FILES["vac_file"]["name"];

move_uploaded_file($tmp_name, "$uploads_dir/$name");
echo '$tmp_name: '. $tmp_name . '; $name: ' . $name;

Array
(
    [vac_file] => Array
        (
            [name] => LFS.desktop
            [type] => application/octet-stream
            [tmp_name] => /tmp/phpV417nF
            [error] => 0
            [size] => 226
        )

)

yeah!
Warning: move_uploaded_file(/uploads/LFS.desktop): failed to open stream: No such file or directory in /srv/http/vacancies_attachment.php on line 47 Warning: move_uploaded_file(): Unable to move '/tmp/phpV417nF' to '/uploads/LFS.desktop' in /srv/http/vacancies_attachment.php on line 47 $tmp_name: /tmp/phpV417nF; $name: LFS.desktop

0 Cevap