Hi , I am using vuejs dropzone package (https://rowanwins.github.io/vue-dropzone/docs/dist/#/installation)
with laravel for my website. I am just wondering how can I remove the uploded image. I can see remove link on hovering image and on click that remove like i want to delete from server as well.
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class ImageController extends Controller
{
/**
* success response method.
*
* @return \Illuminate\Http\Response
*/
public function formSubmit(Request $request)
{
$imageName = time().'.'.$request->file->getClientOriginalExtension();
$request->file->move(public_path('images'), $imageName);
//and then save to db
return response()->json(['success'=>'You have successfully upload file.']);
}
}
Vue2-dropzone either will automatically upload a file when you drop it on it or wait for you to manually upload it. The remove function is a link to remove the file (image) before upload or while uploading not to remove the files from the server.