Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne][Laravel]Zmiana miejsca zapisu
Puchatek320
post
Post #1





Grupa: Zarejestrowani
Postów: 68
Pomógł: 0
Dołączył: 4.11.2019

Ostrzeżenie: (0%)
-----


Cześć,
Mam 2 pytania zaczynam w laravelu i zastanawia mnie w jaki sposób można wyjść storage/app


  1. 'disks' => [
  2.  
  3. 'local' => [
  4. 'driver' => 'local',
  5. 'root' => storage_path('app'),
  6. ],
  7.  
  8. 'public' => [
  9. 'driver' => 'local',
  10. 'root' => storage_path('app/public'),
  11. 'url' => env('APP_URL').'/storage',
  12. 'visibility' => 'public',
  13. ],
  14.  
  15. 's3' => [
  16. 'driver' => 's3',
  17. 'key' => env('AWS_ACCESS_KEY_ID'),
  18. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  19. 'region' => env('AWS_DEFAULT_REGION'),
  20. 'bucket' => env('AWS_BUCKET'),
  21. 'endpoint' => env('AWS_URL'),
  22. ],
  23.  
  24. ],
  25.  
  26. 'out' => [
  27.  
  28. 'localfile' => [
  29. 'driver' => 'local',
  30. 'root' => storage_path('../../'),
  31. ],
  32.  
  33. 'publicfile' => [
  34. 'driver' => 'local',
  35. 'root' => storage_path('filmy'),
  36. 'url' => env('APP_URL').'../../filmy/',
  37. 'visibility' => 'public',
  38. ],
  39.  
  40. 's3' => [
  41. 'driver' => 's3',
  42. 'key' => env('AWS_ACCESS_KEY_ID'),
  43. 'secret' => env('AWS_SECRET_ACCESS_KEY'),
  44. 'region' => env('AWS_DEFAULT_REGION'),
  45. 'bucket' => env('AWS_BUCKET'),
  46. 'endpoint' => env('AWS_URL'),
  47. ],
  48.  
  49. ],


  1. public function save(Request $request){
  2.  
  3. $path = $request->file('filename')->store('publicfile');
  4. return $path;
  5.  
  6. }


próbowałem z out ale coś źle robię, potrzebuje zapisać plik z formularza po za folderem strony obecnie zapisuje mi w strona/storage/app a chciałbym filmy/

mam jeszcze pytanie odnośnie blade a mianowicie w blade mam coś takiego:

  1. <select class="browser-default custom-select col-sm-5" name="katalog">
  2. <option></option>;
  3. <?php if ($handle = opendir('../filmy/')) {
  4. while (false !== ($file = readdir($handle))) {
  5. if ($file != "." && $file != "..") {
  6. echo "<option>".$file."</option>";
  7. }
  8. }
  9. closedir($handle);}?></select>


domyslam się że taką funkcję powinno się gdzieś implementować dobrze myślę? jeśli tak to w jaki sposób

Ktoś coś?

Ten post edytował Puchatek320 27.04.2020, 16:14:42
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
viking
post
Post #2





Grupa: Zarejestrowani
Postów: 6 381
Pomógł: 1116
Dołączył: 30.08.2006

Ostrzeżenie: (0%)
-----


A apache ma dostęp do tego folderu (DocumentRoot)? Czy tak sobie losowo wgrałeś? Dwa wyżej nad storage to jest (przy domyślnej strukturze) poza folderem projektu.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 15.10.2025 - 09:05