ulearnpro / ulearn

ULEARN - Open Source(FREE) LMS script in Laravel 5.8 and ReactJS 16.9
https://www.ulearnpro.com
MIT License
635 stars 290 forks source link

PDF not showing #12

Closed Kipcubic closed 3 years ago

Kipcubic commented 4 years ago

The pdf gets added to the course but can't view it

Swapnil511994 commented 4 years ago

I'm facing the same issue with video files as well as audio items etc

amitad16 commented 4 years ago

I was facing the same problem with every file. Your storage might not be linked.

Type: composer dump-autoload

php artisan storage:link

This might solve the issue for the application cannot read any uploaded files.

And for the @Kipcubic issue:

In the Controllers/CourseController.php file, in the readPDF method :

Replace this line https://github.com/ulearnpro/ulearn/blob/a5a7ca20de859051ea0470542844980a66dfc05d/app/Http/Controllers/CourseController.php#L149

with this: $file = public_path('storage/course/'.$file_details->course_id.'/'.$file_details->file_name.'.'.$file_details->file_extension);

and this line: https://github.com/ulearnpro/ulearn/blob/a5a7ca20de859051ea0470542844980a66dfc05d/app/Http/Controllers/CourseController.php#L155

with this: return response()->file($file);

This solved it for me, might work for you as well.

ramkumarkushavah commented 4 years ago

@amitad16 Thank you so much for sharing the solution. I am able to solve the PDF related issue. But till now not able to solve the banner and video upload issue. Even I have tried you suggestion. If you have the proper code, please share.[Zip File] My mail id is : rkkcct@gmail.com

JayMJ commented 4 years ago

Hi @amitad16 , I am also facing same issue, even after linking the storage, cold you pls share the zip with me too ? my email is mjay.m30@gmail.com

habe90 commented 3 years ago

php artisan storage:link

GET http://www.localhost/storage/course/3/raw_1609688970_intro-16096889704882.mp4 404 (Not Found)

thanh-it38 commented 1 year ago

@amitad16 Cảm ơn bạn rất nhiều vì đã chia sẻ giải pháp. Tôi có thể giải quyết vấn đề liên quan đến PDF. Nhưng cho đến bây giờ không thể giải quyết vấn đề tải lên biểu ngữ và video. Ngay cả tôi đã thử đề xuất của bạn. Nếu bạn có mã phù hợp, vui lòng chia sẻ. [Tệp Zip] Id thư của tôi là: rkkcct@gmail.com

hello, have you fixed the error, if so can i ask for the zip file, thank you very much

thanh-it38 commented 1 year ago

Tôi đã gặp phải vấn đề tương tự với mọi tệp. Bộ nhớ của bạn có thể không được liên kết.

Kiểu: composer dump-autoload

php artisan storage:link

Điều này có thể giải quyết vấn đề ứng dụng không thể đọc bất kỳ tệp nào đã tải lên.

Và đối với@Kipcubicvấn đề:

Trong Controllers/CourseController.phptệp, trong readPDFphương thức:

Thay thế dòng này

https://github.com/ulearnpro/ulearn/blob/a5a7ca20de859051ea0470542844980a66dfc05d/app/Http/Controllers/CourseController.php#L149

Với cái này: $file = public_path('storage/course/'.$file_details->course_id.'/'.$file_details->file_name.'.'.$file_details->file_extension);

và dòng này:

https://github.com/ulearnpro/ulearn/blob/a5a7ca20de859051ea0470542844980a66dfc05d/app/Http/Controllers/CourseController.php#L155

Với cái này: return response()->file($file);

Điều này đã giải quyết nó cho tôi, cũng có thể làm việc cho bạn.

I can't view pdf, video and audio files please help me