When I upload test.apk file it save it as test.zip in laravel 9 I have 2 issue:
1 - it save the file with different name like: jdskfjsljfks
2 - it save the file as .zip, and it is .apk
Could you please share the code?
@Sinnbeck
upload.blade.php:
<html>
<body>
<?php
echo Form::open(array('url' => '/upload','files'=>'true'));
echo 'Select the file to upload.';
echo Form::file('apk');
echo Form::submit('Upload File');
echo Form::close();
?>
</body>
</html>
UploadController:
class UploadController extends Controller
{
public function indexx()
{
return view('upload');
}
public function upload(Request $request)
{
$path = request()->file('apk')->store('apk', 'public');
return redirect()->back();
}
}
web.php:
Route::get('upload','App\Http\Controllers\UploadController@indexx');
Route::post('/upload', 'App\Http\Controllers\UploadController@upload');
Please sign in or create an account to participate in this conversation.