From 76462d14d40be6e37f16d0caedc16433f9c84743 Mon Sep 17 00:00:00 2001 From: David Grant Date: Wed, 26 Mar 2014 02:12:16 -0700 Subject: [PATCH] don't use a new configuration variable for temp dir, just get the temp directory from the OS --- etc/eyefiserver.conf | 1 - usr/local/bin/eyefiserver.py | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/etc/eyefiserver.conf b/etc/eyefiserver.conf index 3a15ce6..c086bd0 100644 --- a/etc/eyefiserver.conf +++ b/etc/eyefiserver.conf @@ -36,7 +36,6 @@ geotag_accuracy:140000 # /home/myblog/pictures/%%Y-%%m-%%d # notice the double percent sign to escape % from ini interpolation -temp_dir:/tmp upload_dir:/home/david/Pictures/eye-fi/%%Y-%%m # The UID of the user that you want to own the uploaded images diff --git a/usr/local/bin/eyefiserver.py b/usr/local/bin/eyefiserver.py index 70a9f1c..69b037a 100755 --- a/usr/local/bin/eyefiserver.py +++ b/usr/local/bin/eyefiserver.py @@ -31,6 +31,7 @@ import StringIO import traceback import errno +import tempfile import hashlib import binascii @@ -644,13 +645,9 @@ def uploadPhoto(self,postData): if geotag_enable: geotag_accuracy = int(self.server.config.get('EyeFiServer','geotag_accuracy')) - tempDir = self.server.config.get('EyeFiServer', 'temp_dir') - - - imageTarPath = os.path.join(tempDir, imageTarfileName) + imageTarPath = os.path.join(tempfile.gettempdir(), imageTarfileName) eyeFiLogger.debug("Generated path " + imageTarPath) - fileHandle = open(imageTarPath, 'wb') eyeFiLogger.debug("Opened file " + imageTarPath + " for binary writing")