ENH: Fix path joiner in zip func
This commit is contained in:
		
							parent
							
								
									da70d93cfe
								
							
						
					
					
						commit
						2500c267be
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		
							
								
								
									
										4
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -9,6 +9,7 @@ import (
 | 
			
		|||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func rootHandler(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
| 
						 | 
				
			
			@ -96,7 +97,8 @@ func Unzip(src, dest string) error {
 | 
			
		|||
			}
 | 
			
		||||
		}()
 | 
			
		||||
 | 
			
		||||
		path := filepath.Join(dest, f.Name)
 | 
			
		||||
		components := strings.Split(f.Name, "/")
 | 
			
		||||
		path := filepath.Join(append([]string{dest}, components...)...)
 | 
			
		||||
 | 
			
		||||
		if f.FileInfo().IsDir() {
 | 
			
		||||
			os.MkdirAll(path, 0755)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue