upload image to public/uploads
This commit is contained in:
		
							parent
							
								
									a04c6ef127
								
							
						
					
					
						commit
						81b368c11c
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -25,3 +25,6 @@ public/js/config.js | ||||
| # ignore webpack build | ||||
| public/build | ||||
| public/views/build | ||||
| 
 | ||||
| public/uploads/* | ||||
| !public/uploads/.gitkeep | ||||
|  | ||||
							
								
								
									
										3
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								app.js
									
									
									
									
									
								
							| @ -405,6 +405,9 @@ app.get('/me', function (req, res) { | ||||
| //upload to imgur
 | ||||
| app.post('/uploadimage', function (req, res) { | ||||
|     var form = new formidable.IncomingForm(); | ||||
|     form.uploadDir = "public/uploads"; | ||||
|     form.keepExtensions = true; | ||||
| 
 | ||||
|     form.parse(req, function (err, fields, files) { | ||||
|         if (err || !files.image || !files.image.path) { | ||||
|             response.errorForbidden(res); | ||||
|  | ||||
							
								
								
									
										0
									
								
								public/uploads/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								public/uploads/.gitkeep
									
									
									
									
									
										Normal file
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user