dimanche 15 décembre 2019

Exception \ FileException Unable to create the "https://ift.tt/34ozxBl" directory, how to send and upload a picture to web/internet? p

i use a laravel 5.8. When i want to send my picture to the internet i have some problem.

i have a problem when i try to upload my image to the internet in laravel. please help me enter image description here

   $request->validate([
        'nama_kelas' => 'required',
        'dari_tanggal' => 'required',
        'sampai_tanggal' => 'required',
        'foto_kelas' => 'required|max:2048',
        'deskripsi' => 'required'
    ]);

    $image = $request->file('foto_kelas');
    // $image = Input::file('foto_kelas');
    // if ($image !== null) {
    //     echo  $new_name = rand() . '.' . $image->getClientOriginalExtension();
    // }
    $new_name = rand() . '.' . $image;
    $destinationPath = 'http://uberando.com/api/upload/image';
    $image->move($destinationPath, $new_name);
    $user = Auth::user();
    $form_data = array(
            'id_users' => $user->id,
            'nama_kelas' => $request->nama_kelas,
            'dari_tanggal' => $request->dari_tanggal,
            'sampai_tanggal' => $request->sampai_tanggal,
            'deskripsi' => $request->deskripsi
    );

    Kelas::create($form_data);
    return redirect('kelas')->with('Sukses', 'Kelas berhasil dibuat');
    return View::make('kelas.update_image', array('user' => $user));
    return view('welcome', compact('kelas'));`enter code here`


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire