From b5c43664e2c2ad455f0819ac84e6c5a2ec0fb9f3 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Fri, 27 Apr 2012 15:43:58 +0200 Subject: [PATCH] tar + directories are now handled correctly --- servefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/servefile b/servefile index 91e9209..18761a5 100755 --- a/servefile +++ b/servefile @@ -541,10 +541,11 @@ class ServeFile(): raise ServeFileException("Error: Could not open file!") handler = FileHandler elif self.serveMode == self.MODE_SINGLETAR: - if not os.path.exists(self.target): + self.realTarget = os.path.realpath(self.target) + if not os.path.exists(self.realTarget): raise ServeFileException("Error: Could not open file or directory") - TarFileHandler.target = self.target - TarFileHandler.fileName = os.path.basename(self.target.rstrip("/")) + TarFileHandler.target = self.realTarget + TarFileHandler.fileName = os.path.basename(self.realTarget.rstrip("/")) handler = TarFileHandler elif self.serveMode == self.MODE_UPLOAD: