# Summernote -2 這篇很亂,斟酌服用 ###### tags: `laravel` ### 多圖片上傳 window.onload Vs document.ready 等畫面長好才開始執行以下js內容,通常寫功能時都會加 [...files] ES6解構,將files中的東西一個一個拿出來,存成一個array。  return 誰發送請求我就回給誰—-fetch的.then會接到 ### foreach   fetch 是取回,第一個參數是要取回的地點,填位置或網址,之前天氣小卡取用Json檔就是透過這個方法。這次我們要調用Controller中的store(取名為summernote)函式,因此我們需要開一隻Route,作為網址傳入第一個參數。 第二個參數則是要做的事,下面是用PUT方法,將 formData 中的資料傳進上面的位置中。 ### 刪除 先新增一route給delete   去controller接看有沒有接到src 有的話繼續  補上then test打錯,要改成text   # 進階挑戰 ## 如何刪掉summernote伺服器上的圖檔? ### 按下summernote刪除圖片後,畫面檔案被刪除了,伺服器上的還在 ### 取出所有img開頭,\結尾的,但還無法拿出src  第二種找文字的方法—用parser,從html  拿一個的寫法  拿很多個的寫法  拿很多個的寫法—-有註解     開頭直接讓他保持base64,不一上傳就儲存  [PHP正規表達式比對](https://medium.com/verybuy-dev/php%E6%AD%A3%E8%A6%8F%E8%A1%A8%E9%81%94%E5%BC%8F%E6%AF%94%E5%B0%8D-89b03ebc10eb) 開始恍神       圖片過大,被SQL擋掉  放開限制  進去裡面改memory_limit,應該要改四個地方,進入的、儲存的,原本40M改成1000M之類的。 # 補充 [Jun-jieChen/summernote](https://github.com/Jun-jieChen/summernote) [Summernote - Delete image from server](https://stackoverflow.com/questions/28078159/summernote-delete-image-from-server) 老師給的替換 [Replace First Occurrence of String With PHP | Beamtic](https://beamtic.com/replace-first-occurrence-php) 均均找到的正規表達式寫法-img、src [Matching SRC attribute of IMG tag using preg_match](https://stackoverflow.com/questions/2180255/matching-src-attribute-of-img-tag-using-preg-match) 嘉威找到ㄉ正規表達式寫法-src [PHP: get image src attribute (regular expression)](https://gist.github.com/vyspiansky/11285153)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up