There are two ways to save images. 1) store image in database by converting it to binary format. 2) copy image in your project folder then save image path in table. ------- 1st way with front end angular------ pass uploaded file in "handleFileInput" function. saveImage ( files : FileList ) { var file : File = files . item ( 0 ); var myReader : FileReader = new FileReader (); myReader . onloadend = ( e ) => { this . image = myReader . result ; } myReader . readAsDataURL ( file ); //convert to base64 ends } now you will get binary format image in this.image variable. save this converted image directly to database through API. ------2nd way with api nodejs------ we can use "multer" to copy file in project folder. const multer = require ( 'multer'...
step 1. first Install npm install capacitor-resources -g step 2. add bellow code to your package.json "scripts": { ... "resources": "capacitor-resources -p android,ios" } step 3. Now Add your icon.png (1024x1024 px) and splash.png (2732x2732 px) in resources folder. Create new resources folder if its is not exists at the same location where package.json exists. step 4. Now run "npm run resources" command and that's it.
step 1: Go to the directory where file exists then use bellow command to open file sudo vi filename step 2: Press i to go to edit mode. now update your file step 3: Now press Esc then type :wq! to save and exit.
Comments
Post a Comment