Search
 
SCRIPT & CODE EXAMPLE
 

PHP

laravel flutter save image in data

public function uploadFile(Request $request) {
        if($request->hasFile('image')) {
            $name = time()."_".$request->file('image')->getClientOriginalName();
            $request->file('image')->move(public_path('images'), $name);
        }
        return response()->json([
            asset("images/$name"),
            201,
            'message' => asset("images/$name") ? 'Image saved' : 'Image failed to save'
        ]);
    }
Comment

PREVIOUS NEXT
Code Example
Php :: How to change add to cart button in wordpress 
Php :: laravel transactions 
Php :: get request uri from request laravel 7 
Php :: php reload current page 
Php :: wordpress on publish hook 
Php :: php get myme type of image 
Php :: logout in laravel 
Php :: apache htaccess read from /public 
Php :: wordpress order by 
Php :: laravel vendor publish all files 
Php :: php get string before character 
Php :: ext-dom php 7.2 
Php :: php Access-Control-Allow-Origin 
Php :: center mode slick slider 
Php :: wordpress print post data 
Php :: how if charactor is exist in text in laravel 
Php :: repeater acf 
Php :: get duplicate value from array php 
Php :: the token has been blacklisted laravel jwt 
Php :: php 301 redirect 
Php :: laravel date validation 
Php :: laravel upload image to public folder 
Php :: block direct access to php images 
Php :: php header base64 pdf 
Php :: php validate name 
Php :: do shortcode wordpress 
Php :: preg_match number only in php 
Php :: cart icon in woocommerce 
Php :: php error display 
Php :: laravel export make comman 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =