symfony - How to upload an image using Sonata Media Bundle -


i working on project using symfony.i want use sonata media bundle,in order upload image. unfortunately don't knwo how use or how start.

i havethis form :

<form action="" method="post" class="filephotoform form-inline" role="form">                             <div class="form-group">                                 <input type="button" class="btn btn-start-order browse" value="browse">                                 <input type="text" class="form-control file-name" readonly="readonly" placeholder="no file selected">                                 <input type="file" name="filephoto" id="filephoto" class="hidden file-upload">                             </div><br/><br/>                             <button type="submit" class="btn btn-primary">submit</button>                         </form> 

and code in controller:

 public function changepictureaction(request $request)     {           return $this->render('medappbundle:profile:change_picture.html.twig');     } 

can basics of uploading?

thank you!


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -