MahmoudAdelAli's avatar

Storage Files Not Found And 500 Error With Heroku

Hello , i have issue after uploading my project to heroku , every thing is okay but when i upload file like cv or resume i cant download it or open it i got 404 error and there's post request to add task , i got 500 error when add it but in my local host work correctly , the logs to add task

2022-08-02T14:53:21.585889+00:00 app[web.1]: 10.1.84.197 - - [02/Aug/2022:14:53:21 +0000] "POST /tasks HTTP/1.1" 500 2059 "http://damp-coast-29226.herokuapp.com/tasks" "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0

the route

Route::group(['prefix' => 'tasks', 'as' => 'tasks.'], function () {
    Route::delete('/{task}', [TaskController::class, 'destroy'])->name('destroy');
    Route::patch('/{task}', [TaskController::class, 'update'])->name('update');
    Route::get('/{task}', [TaskController::class, 'show'])->name('show');
    Route::get('/status/{task}', [TaskController::class, 'status'])->name('status');
    Route::resource('/', TaskController::class);
    Route::resource('/manage/types', TaskTypeController::class);
    Route::resource('/attachments', TaskAttachmentController::class);
  });

the weird thing is all modules like add client work correctly and the images too work when i invoke to with src but any file to download or open not working , file download logs

2022-08-02T14:58:14.741060+00:00 app[web.1]: 10.1.35.74 - - [02/Aug/2022:14:58:14 +0000] "GET /storage/clients/documents/2022-08-02/Basil/sgq4Xr8AkMfyHXDMuNYgfjfBQIwY0qitIWn0aAmN.txt HTTP/1.1" 404 2059 "http://damp-coast-29226.herokuapp.com/clients/24" "Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0

0 likes
3 replies
MohamedTammam's avatar

Heroku has an “ephemeral” hard drive, this means that you can write files to disk, but those files will not persist after the application is restarted

Don't store files on Heroku, use cloud storage.

1 like
MahmoudAdelAli's avatar

@MohamedTammam thank u to tell me that , but how i can use a cloud storage with heroku ? cause i searched and i didn't find any related issues

Please or to participate in this conversation.