diff --git a/pyscript/plot.py b/pyscript/plot.py index 7794ab6..de45aa0 100644 --- a/pyscript/plot.py +++ b/pyscript/plot.py @@ -73,6 +73,8 @@ class PlotView(object): key = self.traverse_subpath[0] else: key = self.request.form.get('image', 'not_found') + if '.' in key: # remove extension possibly added to make Flash happy + key = key.split('.', 1)[0] path = cachedImages[key].path self.setHeaders(path) f = open(path, 'rb') diff --git a/pyscript/rstat.py b/pyscript/rstat.py index 09633bc..dfb50aa 100644 --- a/pyscript/rstat.py +++ b/pyscript/rstat.py @@ -71,5 +71,5 @@ class RStat(object): context = self.context fn, robj = gdd(**kw) key = registerImage(fn) - return '%s/@@plot?image=%s' % (absoluteURL(context, request), key) + return '%s/@@plot?image=%s.jpg' % (absoluteURL(context, request), key)