MJansing's avatar

Uploading a P12 File

Hi Guys,

I've got the following Problem:

I want to store the p12 KeyStore Files of my customers in my System, written in Laravel 5.3

The Upload is complete, but I've got the following Message:

FileException in UploadedFile.php line 236: The file "KeyStore.p12" was not uploaded due to an unknown error.

The Code for Upload a File:

    $mime = [
                'application/keychain_access',
                'application/x-pkcs12'
            ];


            if(!in_array(Input::file($key)->getClientMimeType(), $mime))
            {
                return redirect(url(config('app.locale').'/admin/api/user_edit/'.$user_id))
                    ->withInput()
                    ->withErrors('Nur P12 Dateien erlaubt');
            }


            $path = public_path('ID_Check_files/keystores/').$user->get_user()->first()->email;
            if(!File::exists($path)) {
                File::makeDirectory($path);
            }


            $filename = Input::file($key)->getClientOriginalName();
            Input::file($key)->move($path, $filename);
            $user->$key = $path.'/'.
                $filename;
0 likes
0 replies

Please or to participate in this conversation.