├── public
├── favicon.ico
└── index.html
├── src
├── assets
│ ├── logo.png
│ └── logo.svg
├── plugins
│ └── vuetify.js
├── http-common.js
├── main.js
├── App.vue
├── services
│ └── UploadFilesService.js
└── components
│ └── UploadFiles.vue
├── babel.config.js
├── vue.config.js
├── .gitignore
├── package.json
└── README.md
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezkoder/vuetify-file-upload/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezkoder/vuetify-file-upload/HEAD/src/assets/logo.png
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/vue.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | transpileDependencies: ["vuetify"],
3 | devServer: {
4 | port: 8081,
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/src/plugins/vuetify.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuetify from 'vuetify/lib';
3 |
4 | Vue.use(Vuetify);
5 |
6 | export default new Vuetify({
7 | });
8 |
--------------------------------------------------------------------------------
/src/http-common.js:
--------------------------------------------------------------------------------
1 | import axios from "axios";
2 |
3 | export default axios.create({
4 | baseURL: "http://localhost:8080",
5 | headers: {
6 | "Content-type": "application/json"
7 | }
8 | });
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App.vue'
3 | import vuetify from './plugins/vuetify';
4 |
5 | Vue.config.productionTip = false
6 |
7 | new Vue({
8 | vuetify,
9 | render: h => h(App)
10 | }).$mount('#app')
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /dist
4 |
5 | # local env files
6 | .env.local
7 | .env.*.local
8 |
9 | # Log files
10 | npm-debug.log*
11 | yarn-debug.log*
12 | yarn-error.log*
13 |
14 | # Editor directories and files
15 | .idea
16 | .vscode
17 | *.suo
18 | *.ntvs*
19 | *.njsproj
20 | *.sln
21 | *.sw?
22 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
bezkoder.com
6 | Vuetify File Upload
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
24 |
--------------------------------------------------------------------------------
/src/services/UploadFilesService.js:
--------------------------------------------------------------------------------
1 | import http from "../http-common";
2 |
3 | class UploadFilesService {
4 | upload(file, onUploadProgress) {
5 | let formData = new FormData();
6 |
7 | formData.append("file", file);
8 |
9 | return http.post("/upload", formData, {
10 | headers: {
11 | "Content-Type": "multipart/form-data"
12 | },
13 | onUploadProgress
14 | });
15 | }
16 |
17 | getFiles() {
18 | return http.get("/files");
19 | }
20 | }
21 |
22 | export default new UploadFilesService();
--------------------------------------------------------------------------------
/src/assets/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | <%= htmlWebpackPlugin.options.title %>
9 |
10 |
11 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "vuetify-file-upload",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "serve": "vue-cli-service serve",
7 | "build": "vue-cli-service build",
8 | "lint": "vue-cli-service lint"
9 | },
10 | "dependencies": {
11 | "axios": "^0.19.2",
12 | "core-js": "^3.6.4",
13 | "vue": "^2.6.11",
14 | "vuetify": "^2.2.11"
15 | },
16 | "devDependencies": {
17 | "@vue/cli-plugin-babel": "^4.3.0",
18 | "@vue/cli-plugin-eslint": "^4.3.0",
19 | "@vue/cli-service": "^4.3.0",
20 | "babel-eslint": "^10.1.0",
21 | "eslint": "^6.7.2",
22 | "eslint-plugin-vue": "^6.2.2",
23 | "sass": "^1.19.0",
24 | "sass-loader": "^8.0.0",
25 | "vue-cli-plugin-vuetify": "^2.0.5",
26 | "vue-template-compiler": "^2.6.11",
27 | "vuetify-loader": "^1.3.0"
28 | },
29 | "eslintConfig": {
30 | "root": true,
31 | "env": {
32 | "node": true
33 | },
34 | "extends": [
35 | "plugin:vue/essential",
36 | "eslint:recommended"
37 | ],
38 | "parserOptions": {
39 | "parser": "babel-eslint"
40 | },
41 | "rules": {}
42 | },
43 | "browserslist": [
44 | "> 1%",
45 | "last 2 versions",
46 | "not dead"
47 | ]
48 | }
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Vuetify File Upload example
2 |
3 | For more details, please visit:
4 | > [Vuetify File Upload example with Progress Bar](https://bezkoder.com/vuetify-file-upload/)
5 |
6 | Rest APIs server for this Vue Client:
7 | > [Node.js Express File Upload Rest API example](https://bezkoder.com/node-js-express-file-upload/)
8 |
9 | > [Node.js Express File Upload with Google Cloud Storage example](https://bezkoder.com/google-cloud-storage-nodejs-upload-file/)
10 |
11 | > [Spring Boot Multipart File upload example](https://bezkoder.com/spring-boot-file-upload/)
12 |
13 | More Practice:
14 | > [Vuetify Image Upload with Preview example](https://bezkoder.com/vuetify-image-upload-preview/)
15 |
16 | > [Vuetify Multiple Images Upload example with Progress Bar](https://bezkoder.com/vuetify-multiple-image-upload/)
17 |
18 | > [Vuetify CRUD App example | v-data-table](https://bezkoder.com/vuetify-data-table-example/)
19 |
20 | > [Vuetify Pagination (Server Side) example](https://bezkoder.com/vuetify-pagination-server-side/)
21 |
22 | Fullstack CRUD App:
23 | > [Vue.js + Node.js + Express + MySQL](https://bezkoder.com/vue-js-node-js-express-mysql-crud-example/)
24 |
25 | > [Vue.js + Node.js + Express + PostgreSQL](https://bezkoder.com/vue-node-express-postgresql/)
26 |
27 | > [Vue.js + Node.js + Express + MongoDB](https://bezkoder.com/vue-node-express-mongodb-mevn-crud/)
28 |
29 | > [Vue.js + Spring Boot + Embedded Database example](https://bezkoder.com/spring-boot-vue-js-crud-example/)
30 |
31 | > [Vue.js + Spring Boot + MySQL example](https://bezkoder.com/spring-boot-vue-js-mysql/)
32 |
33 | > [Vue.js + Spring Boot + PostgreSQL example](https://bezkoder.com/spring-boot-vue-js-postgresql/)
34 |
35 | > [Vue.js + Spring Boot + MongoDB](https://bezkoder.com/spring-boot-vue-mongodb/)
36 |
37 | > [Vue.js + Django Rest Framework](https://bezkoder.com/django-vue-js-rest-framework/)
38 |
39 | Integration (run back-end & front-end on same server/port)
40 | > [Integrate Vue App with Spring Boot](https://bezkoder.com/integrate-vue-spring-boot/)
41 |
42 | > [Integrate Vue App with Node.js Express](https://bezkoder.com/serve-vue-app-express/)
43 |
44 | Serverless with Firebase:
45 | > [Vue Firebase Realtime Database: CRUD example](https://bezkoder.com/vue-firebase-realtime-database/)
46 |
47 | > [Vue Firestore CRUD example](https://bezkoder.com/vue-firestore-crud/)
48 |
49 | ## Project setup
50 | ```
51 | npm install
52 | ```
53 |
54 | ### Compiles and hot-reloads for development
55 | ```
56 | npm run serve
57 | ```
58 |
59 | ### Compiles and minifies for production
60 | ```
61 | npm run build
62 | ```
63 |
64 | ### Run your tests
65 | ```
66 | npm run test
67 | ```
68 |
69 | ### Lints and fixes files
70 | ```
71 | npm run lint
72 | ```
73 |
74 | ### Customize configuration
75 | See [Configuration Reference](https://cli.vuejs.org/config/).
76 |
--------------------------------------------------------------------------------
/src/components/UploadFiles.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 | {{ progress }} %
12 |
13 |
14 |
15 |
16 |
17 |
18 |
23 |
24 |
25 |
26 |
27 | Upload
28 | mdi-cloud-upload
29 |
30 |
31 |
32 |
33 |
34 | {{ message }}
35 |
36 |
37 |
38 |
39 | List of Files
40 |
41 |
42 | {{ file.name }}
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
102 |
--------------------------------------------------------------------------------