Все еще не работат
This commit is contained in:
		
							parent
							
								
									b4ea9a0665
								
							
						
					
					
						commit
						04dbef81f6
					
				|  | @ -28,9 +28,12 @@ public function index(Request $request) | ||||||
|                 return response(json_encode($response)); |                 return response(json_encode($response)); | ||||||
|             } else { |             } else { | ||||||
|                 $videotitle = $video->getFile()->getFilename(); // Will return Phonebloks
 |                 $videotitle = $video->getFile()->getFilename(); // Will return Phonebloks
 | ||||||
|  | 		$videotitle = str_replace('webp', 'mp4', $videotitle); | ||||||
|  | 		//$file_path = public_path('/'.'downloads/'.$videotitle);
 | ||||||
|  |         	//return response()->download($file_path);
 | ||||||
|                 // $video->getFile(); // \SplFileInfo instance of downloaded file
 |                 // $video->getFile(); // \SplFileInfo instance of downloaded file
 | ||||||
|                 //$file_path = public_path('/downloads/'.$videotitle);
 |                 //$file_path = public_path('/downloads/'.$videotitle);
 | ||||||
|                 return redirect()->route('/download/'.$videotitle); |                 return redirect()->route('download', [$videotitle]); | ||||||
|                 //return response()->download($file_path);
 |                 //return response()->download($file_path);
 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -20,12 +20,14 @@ export default { | ||||||
|     name: "Main", |     name: "Main", | ||||||
|     data: () => ({ |     data: () => ({ | ||||||
|         url: ref(''), |         url: ref(''), | ||||||
|  | 	fetching: ref(false) | ||||||
|     }), |     }), | ||||||
|     methods: { |     methods: { | ||||||
|         startDownload(){ |         startDownload(){ | ||||||
|             console.log(this.url); |             this.fetching = true; | ||||||
|             axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{ |             axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{ | ||||||
|                 console.log(responce); | 		this.fetching = false; | ||||||
|  | 		console.log(responce); | ||||||
|             }) |             }) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -18,4 +18,4 @@ | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| Route::get('/download_api', 'App\Http\Controllers\YoutubeDownloadController@index'); | Route::get('/download_api', 'App\Http\Controllers\YoutubeDownloadController@index'); | ||||||
| Route::get('/download/{file}', 'App\Http\Controllers\DownloadController@download'); | Route::get('/download/{file}', 'App\Http\Controllers\DownloadController@download')->name('download'); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue