except:
return http.Response(responsecode.OK, stream="no file given with file=???")
if parts.has_key("file"):
- path = "/hdd/movie/"+self.decodeURI(parts["file"])
+ path = "/hdd/movie/"+parts["file"]
if os.path.exists(path):
self.filehandler = open(path,"r")
s = myFileStream(self.filehandler)
resp = http.Response(responsecode.OK, {'Content-type': http_headers.MimeType('video', 'ts')},stream=s)
- resp.headers.addRawHeader('Content-Disposition','attachment; filename="%s"'%self.decodeURI(parts["file"]))
+ resp.headers.addRawHeader('Content-Disposition','attachment; filename="%s"'%parts["file"])
return resp
else:
- return http.Response(responsecode.OK, stream="file '%s' was not found in /media/hdd/movie/"%self.decodeURI(parts["file"]))
+ return http.Response(responsecode.OK, stream="file '%s' was not found in /media/hdd/movie/"%parts["file"])
else:
return http.Response(responsecode.OK, stream="no file given with file=???")
- def decodeURI(self,uri):
- """
- i dont have found a function that will do it in a clean way, so i do it like this
- change it, if you have foound one
- """
- new = uri.encode("UTF-8").replace("%20"," ").replace("+"," ")
- new = new.replace("%C3%B6","ö")
- new = new.replace("%C3%96","Ö")
- new = new.replace("%C3%A4'","ä")
- new = new.replace("%C3%84'","Ä")
- new = new.replace("%C3%BC","ü")
- new = new.replace("%C3%9C","Ü")
- new = new.replace("%C3%9F","ß")
-
- return new
\ No newline at end of file