diff --git a/source/madpy/djangoMad/apps/updata/views.py b/source/madpy/djangoMad/apps/updata/views.py index 439bca2..6c1256d 100755 --- a/source/madpy/djangoMad/apps/updata/views.py +++ b/source/madpy/djangoMad/apps/updata/views.py @@ -26,13 +26,13 @@ def index(request): siteName, siteList = madWebObj.getSiteInfo() err = False if request.method == 'POST': - for root, folders, tmp_files in os.walk('/tmp/'): + for root, folders, tmp_files in os.walk('/madrigal/experiments/tmp/'): for f in tmp_files: os.remove(os.path.join(root, f)) form = UpdataForm(request.POST, request.FILES) - files = list(request.FILES.getlist('file')) - files.sort() + files = request.FILES.getlist('file') + # files.sort() filenames = [] choose = request.POST.get('choose') @@ -51,9 +51,9 @@ def index(request): first = True if len(files) == 1: - fs = FileSystemStorage(location='/tmp') + fs = FileSystemStorage(location='/madrigal/experiments/tmp') fs.save(files[0].name, files[0]) - filename = os.path.join('/tmp', files[0].name) + filename = os.path.join('/madrigal/experiments/tmp', files[0].name) fileInfo = madrigal.data.MadrigalFile(filename, madDB) sTime = fileInfo.getEarliestTime() startTime = datetime.datetime(sTime[0],sTime[1],sTime[2],sTime[3],sTime[4],sTime[5]) @@ -71,8 +71,8 @@ def index(request): 'An error occur adding file {}: {}'.format(filename.split('/')[-1], e) ) else: - if os.path.exists(os.path.join('/tmp', 'overview', files[0].name + '.summary')): - os.remove(os.path.join('/tmp', 'overview', files[0].name + '.summary')) + if os.path.exists(os.path.join('/madrigal/experiments/tmp', 'overview', files[0].name + '.summary')): + os.remove(os.path.join('/madrigal/experiments/tmp', 'overview', files[0].name + '.summary')) ext = filename.split('.')[-1] if ext not in ('hdf5', 'h5'): convert = True @@ -89,9 +89,9 @@ def index(request): filenames.append(filename.split('/')[-1]) else: for f in files: - fs = FileSystemStorage(location='/tmp') + fs = FileSystemStorage(location='/madrigal/experiments/tmp') fs.save(f.name, f) - filename = os.path.join('/tmp', f.name) + filename = os.path.join('/madrigal/experiments/tmp', f.name) ext = filename.split('.')[-1] if ext not in ('hdf5', 'h5'): convert = True