简体   繁体   中英

fortrabbit files laravel 5.2

I have a page in fortrabit check in laravel , the problem is: I have a form to upload pictures ( that's fine no error) but when I want to show the images sometimes shows me and the other sends me 404

local environment if it works code:

<div class="row">
  @foreach($article as $a)
  <div class="col-lg-3 col-md-4 col-xs-6 thumb">
    <input type="hidden" value="{{ $a->id }}" id="article">
    <a class="thumbnail" href="#">
      <img class="img-responsive" src="images/{{ $a->image }}" style="width:150px; height:100px; " alt="">
      </a>
      <h4 class="text-center">{{ $a->title }}</h4>
      <h5 class="text-center"><strong>$ {{ $a->price }}.00</strong></h5>
      <hr>
      <button ng-clik="adde()" class="btn btn-block btn-default">
        <i class="ion-ios-cart"></i> Añadir a carro
      </button>
  </div>
  @endforeach
</div>

Maybe it's not in the code. It can have other reasons:

  1. You are using an New App with ephemeral storage, each time you deploy, all files on the local file system will be deleted.
  2. You are using a New App that runs on multiple Nodes, the images are only stored in one of the local file systems, not both.

In any case: Uploaded images must be transferred to a cloud storage. Use the Object Storage Component or an external service such AWS S3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM