第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

警告 move_uploaded_file():無(wú)法在 php 中移動(dòng)音頻文件

警告 move_uploaded_file():無(wú)法在 php 中移動(dòng)音頻文件

PHP
BIG陽(yáng) 2022-06-11 09:55:13
我有使用 Recorder.js 的簡(jiǎn)單 Record Wave 腳本現(xiàn)在問(wèn)題是記錄沒(méi)問(wèn)題減少到我的記錄還可以從blob下載記錄文件沒(méi)問(wèn)題上傳記錄文件(這里是問(wèn)題)操作系統(tǒng) ( windows 10 & appserv )我的上傳.php  <?php    print $_FILES["audio_data"]["tmp_name"]; //this will print out the received name, temp name, type, size, etc.    //check if upload folder exist or not    if(!is_dir("uploads")){        $res = mkdir("uploads",0777);     }    $size = $_FILES['audio_data']['size']; //the size in bytes    $input = $_FILES['audio_data']['tmp_name']; //temporary name that PHP gave to the uploaded file    $output = $_FILES['audio_data']['name'].".wav"; //letting the client control the filename is a rather bad idea    //move the file from temp name to local folder using $output name    move_uploaded_file($input, $output)    ?>我的 js 文件的一部分function createDownloadLink(blob) {    var url = URL.createObjectURL(blob);    var au = document.createElement('audio');    var li = document.createElement('li');    var link = document.createElement('a');    //name of .wav file to use during upload and download (without extendion)    var filename = new Date().toISOString();    //add controls to the <audio> element    au.controls = true;    au.src = url;    //save to disk link    link.href = url;    link.download = filename+".wav"; //download forces the browser to donwload the file using the  filename    link.innerHTML = "Save to disk";    //add the new audio element to li    li.appendChild(au);    //add the filename to the li    li.appendChild(document.createTextNode(filename+".wav "))    //add the save to disk link to li    li.appendChild(link);
查看完整描述

1 回答

?
呼喚遠(yuǎn)方

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超11個(gè)贊

您正在使用輸出目錄作為文件名,因此會(huì)引發(fā)錯(cuò)誤。

由于您的上傳目錄是上傳。

試著更新一下:

$output ="uploads/".$_FILES['audio_data']['name'].".wav";


查看完整回答
反對(duì) 回復(fù) 2022-06-11
  • 1 回答
  • 0 關(guān)注
  • 87 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)