Все еще не работат
This commit is contained in:
		
							parent
							
								
									b4ea9a0665
								
							
						
					
					
						commit
						04dbef81f6
					
				|  | @ -28,9 +28,12 @@ public function index(Request $request) | |||
|                 return response(json_encode($response)); | ||||
|             } else { | ||||
|                 $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
 | ||||
|                 //$file_path = public_path('/downloads/'.$videotitle);
 | ||||
|                 return redirect()->route('/download/'.$videotitle); | ||||
|                 return redirect()->route('download', [$videotitle]); | ||||
|                 //return response()->download($file_path);
 | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -20,11 +20,13 @@ export default { | |||
|     name: "Main", | ||||
|     data: () => ({ | ||||
|         url: ref(''), | ||||
| 	fetching: ref(false) | ||||
|     }), | ||||
|     methods: { | ||||
|         startDownload(){ | ||||
|             console.log(this.url); | ||||
|             this.fetching = true; | ||||
|             axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{ | ||||
| 		this.fetching = false; | ||||
| 		console.log(responce); | ||||
|             }) | ||||
|         } | ||||
|  |  | |||
|  | @ -18,4 +18,4 @@ | |||
| }); | ||||
| 
 | ||||
| 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