2017-06-30 2 views
0

レコードを整理するためのアプリケーションを作成しました。リストにはいくつかのpdfリンクがあります。コンピュータでドメインにアクセスすると、新しいタブでpdfが開き、すべて正常に動作しますが、 )ファイルがダウンロードされます。このダウンロードが行われないようにする方法はありますか?コンテンツを表示するiFrameを使用することを考えましたが、まずはこの問題を迂回する代替方法があるかどうかを知りたいと思います。 PDFのURLと私のテーブルモバイル経由でURLをクリックしたときにPDFをダウンロードしないにはどうすればよいですか?

<table class="table"> 
      <tr> 
      <th>Data</th> 
      <th>Nº Pedido</th> 
      <th>Cliente</th> 
      <th>Valor</th> 
      <th>Pedido</th> 
      <th>Serasa</th> 
      <th>Histórico</th> 
      <th>Status</th> 
      <th></th> 
      </tr> 
      @foreach($orders as $value) 
      <tr> 
      <td>{{date_format($value->created_at,'d-m-Y')}}</td> 
      <td>{{$value->ph_pedido}}</td> 
      <td>{{substr($value->ph_cliente,0,15)}}...</td> 
      <td>R${{ number_format($value->ph_valor, 2, '.', '')}}</td> 
      <td><a href="{{$value->ph_urlpdf}}" target="_blank" data-toggle="tooltip" data-placement="top" title="Clique para acessar"data-toggle="tooltip" data-placement="top" title="Tooltip on top">@if($value->ph_urlpdf == null)<img src="https://s3-sa-east-1.amazonaws.com/comercio-urbano/Product/marcas/tycoontech/647716-pdf-24.png"> @else <img src="https://cdn3.iconfinder.com/data/icons/document-icons-2/30/647716-pdf-24.png" alt="">@endif</a></td> 
      <td><a href="{{$value->ph_urlserasa}}" target="_blank" data-toggle="tooltip" data-placement="top" title="Clique para acessar">@if($value->ph_urlserasa == null)<img src="https://s3-sa-east-1.amazonaws.com/comercio-urbano/Product/marcas/tycoontech/647716-pdf-24.png"> @else <img src="https://cdn3.iconfinder.com/data/icons/document-icons-2/30/647716-pdf-24.png" alt="">@endif</a></td> 
      <td><a href="{{$value->ph_historico}}" target="_blank" data-toggle="tooltip" data-placement="top" title="Clique para acessar">@if($value->ph_historico == null)<img src="https://s3-sa-east-1.amazonaws.com/comercio-urbano/Product/marcas/tycoontech/647716-pdf-24.png"> @else <img src="https://cdn3.iconfinder.com/data/icons/document-icons-2/30/647716-pdf-24.png" alt="">@endif</a></td> 
      @if(Auth::user()->admin == 1) 
      <td> 
       @if($value->ph_approved == 1) 
       <a href="orders/approve/{{$value->ph_orderid}}"><label class="label label-success">Aprovado</label></a> 
       @elseif($value->ph_approved == 0) 
       <a href="orders/approve/{{$value->ph_orderid}}"><label class="label label-danger">Não aprovado</label></a> 
       @elseif($value->ph_approved == 3) 
       <a href="orders/approve/{{$value->ph_orderid}}"><label class="label label-warning">Pendente</label></a> 
       @endif 
      </td> 
      @else 
      <td> 
       @if($value->ph_approved == 1) 
       <label class="label label-success">Aprovado</label> 
       @elseif($value->ph_approved == 0) 
       <label class="label label-danger">Não aprovado</label> 
       @elseif($value->ph_approved == 3) 
       <label class="label label-warning">Pendente</label> 
       @endif 
      </td> 
      @endif 
      <tr> 
      @endforeach 
      </table> 

任意の提案?前もって感謝します!

+0

私はあなたのコードとは関係がないと思います。デフォルトの動作は問題ありません。モバイルブラウザでPDFを開くことができるかどうか教えてください。私はブラウザがPDFを表示することができないので、ダウンロードしようとすると思います。 –

+0

解決策を見つけました。私自身の質問に答えると、stackoverflowはそれに対して私を罰するでしょうか? –

答えて

0

自分のリンクの前にコードhttp://docs.google.com/gview?embedded=true&url=を追加すると、自分のリンクをgoogle docsにリダイレクトして、ダウンロードする代わりにドキュメントを見ることができます。

関連する問題