如何使用laravel存储正确获取html文件内容?

时间:2018-02-07 17:34:23

标签: php laravel snappy laravel-storage

我试图获取我以前保存的html文件的内容,当我检查html的所有内容是否正确时,但是当我尝试访问它时这样做:

$html = Storage::disk('local')->get(Session('view'));

我得到一个包含我的html部分的字符串,我不明白为什么我的html全部被破坏,对我可能做错了什么的想法?

原始档案:

  <meta charset="UTF-8">
    <link href="http://127.0.0.1:8000/css/pdfpreview.css" rel="stylesheet" type="text/css">
    <div class="pdfContainer">
        <img src="http://127.0.0.1:8000/image/logo.png">
        <div class="soumissionInfoContainer">
            <h2>Soumission</h2>
            <p>Soumission S2-18</p>
            <p>Date: 20-02-2017</p>

        </div>
        <div class="clientInfoContainer">
            <h3>Destinataire</h3>
            <strong>Jean Tremblay</strong>
            <p>1010 St Hubert</p>
            <p>G7H 2B1</p>
            <p>418 555 5555</p>
        </div>
        <table class="previewTable">
            <tbody><tr>
            </tr><tr>
                <th>Quantité</th>
                <th>Description</th>
                <th>Prix</th>
            </tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                        </tbody></table>
                    <p class="totalSoumission">TOTAL AVANT
            TAXES: 0$</p>
        <div class="ligne_signature">
            À la signature, ce devis est bon pour travaux et valide 90 jours
        </div>
    </div>

我从转储$html

获得的输出
"""
\r\n
    <meta charset="UTF-8">\r\n
    <link href="http://127.0.0.1:8000/css/pdfpreview.css" rel="stylesheet" type="text/css">\r\n
    <div class="pdfContainer">\r\n
        <img src="http://127.0.0.1:8000/image/logo.png">\r\n
        <div class="soumissionInfoContainer">\r\n
            <h2>Soumission</h2>\r\n
            <p>Soumission S2-18</p>\r\n
            <p>Date: 20-02-2017</p>\r\n
\r\n
        </div>\r\n
        <div class="clientInfoContainer">\r\n
            <h3>Destinataire</h3>\r\n
            <strong>Jean Tremblay</strong>\r\n
            <p>1010 St Hubert</p>\r\n
            <p>G7H 2B1</p>\r\n
            <p>418 555 5555</p>\r\n
        </div>\r\n
        <table class="previewTable">\r\n
            <tbody><tr>\r\n
            </tr><tr>\r\n
                <th>Quantité</th>\r\n
                <th>Description</th>\r\n
                <th>Prix</th>\r\n
            </tr>\r\n
                                                                                                                                                                                                                                                                                                                                                                                                                                               </tbody></table>\r\n

0 个答案:

没有答案