Laravel 当我通过手机点击url时,如何不下载pdf?
我创建了一个应用程序来组织记录,列表中有一些pdf链接,当我通过计算机访问域时,pdf会在一个新选项卡中打开,所有事情都会正常进行,但当我从手机(特别是Android)访问时,文件会被下载。有没有办法阻止下载?我曾考虑使用一个显示内容的iFrame,但首先我想知道是否有其他方法可以解决这个问题 带有pdf url的我的表格Laravel 当我通过手机点击url时,如何不下载pdf?,laravel,iframe,bootstrap-modal,Laravel,Iframe,Bootstrap Modal,我创建了一个应用程序来组织记录,列表中有一些pdf链接,当我通过计算机访问域时,pdf会在一个新选项卡中打开,所有事情都会正常进行,但当我从手机(特别是Android)访问时,文件会被下载。有没有办法阻止下载?我曾考虑使用一个显示内容的iFrame,但首先我想知道是否有其他方法可以解决这个问题 带有pdf url的我的表格 <table class="table"> <tr> <th>Data</th>
<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>
资料
佩蒂多
客户
英勇
佩蒂多
塞拉萨
希斯托里科
地位
@foreach(订单为$value)
{{date_格式($value->created_at,'d-m-Y')}
{{$value->ph_pedido}
{{substr($value->ph_客户,0,15)}。。。
R${{number_格式($value->ph_valor,2,'.',''.')}
@如果(Auth::user()->admin==1)
@如果($value->ph_approved==1)
@elseif($value->PHU批准==0)
@elseif($value->PHU批准==3)
@恩迪夫
@否则
@如果($value->ph_approved==1)
阿普罗瓦多
@elseif($value->PHU批准==0)
Não aprovado
@elseif($value->PHU批准==3)
彭登特
@恩迪夫
@恩迪夫
@endforeach
有什么建议吗?提前谢谢 我找到了解决方案,如果我添加代码
http://docs.google.com/gview?embedded=true&url=
在我链接之前,我会将我的链接重定向到谷歌文档,这样我就可以看到文档而不是下载的文档。我认为这与你的代码无关。违约行为很好。告诉我您是否能够在移动浏览器中打开PDF?我想,既然浏览器无法处理显示PDF,就尝试下载。我找到了一个解决方案,如果我回答自己的问题,stackoverflow会因此惩罚我吗?