Downloads a file from a specific URL and returns a Deferred. You can also specify a callback function to be called as parts are received.
| Parameters: |
|
|---|---|
| Returns: | the filename of the downloaded file |
| Return type: | Deferred |
| Raises t.w.e.PageRedirect: | |
when server responds with a temporary redirect or permanently moved. |
|
| Raises t.w.e.Error: | |
for all other HTTP response errors (besides OK) |
|
Sanitises a filename to use as a download destination file. Logs any filenames that could be considered malicious.
| Parameter: | filename (string) – the filename to sanitise |
|---|---|
| Returns: | the sanitised filename |
| Return type: | string |
| Raises IOError: | when the filename exists |