Search code examples
vue.jsfile-uploadvue-componentlumen

Is it possible to upload file on vuejs public folder?


I just want to ask if there's a way to upload the file on vuejs public folder then save the filename on the database via API?.

like the image will save at vuejs public folder then the name of the image will be saved on the database.

hope you can help me with this.

thanks


Solution

  • When you run the build command for creating the dist folder of your app all your app is bundled into 1 folder. Also all the existing assets are renamed with hashes like image1.png would be image.123234.png in your dist bundle. So you cannot change or append anything to that bundle. You can directly upload the file to the database(storage).