2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-22 20:45:20 +00:00

rename surveyscansingle

This commit is contained in:
Philip Sargent
2021-04-26 17:40:48 +01:00
parent 9e11c0814e
commit b8803c8e5b
3 changed files with 5 additions and 5 deletions

View File

@@ -29,13 +29,13 @@ def surveyscansfolder(request, path):
message = f'Scan folder error or not found \'{path}\' .'
return render(request, 'errors/generic.html', {'message': message})
def surveyscansingle(request, path, file):
def scansingle(request, path, file):
'''sends a single binary file to the user for display - browser decides how using mimetype
'''
try:
scansfolder = ScansFolder.objects.get(walletname=urlunquote(path))
singlescan = SingleScan.objects.get(scansfolder=scansfolder, name=file)
# print(" - surveyscansingle {}:{}:{}:".format(path, file, getmimetype(file)))
# print(" - scansingle {}:{}:{}:".format(path, file, getmimetype(file)))
return HttpResponse(content=open(singlescan.ffile,"rb"), content_type=getmimetype(file)) # any type of image
except:
message = f'Scan folder or scan item error or not found \'{path}\' and \'{file}\'.'