The Un-Official Proxomitron Forum

Full Version: [Req] file sizes instead of downloads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I was wondering if there is a way for Proxomitron to give out the filesize of a download (application, archive, multimedia...) Instead of letting the browser to download.

Example - I click on a link http://www.setup.com/setup.exe, then Proxomitron takes HTTP header response (but doesn't download the exe) and gives the size of the file to the browser in a special page.

It would be nice if I could myself customize the file extensions list which Proxomitron processes like this. Also it would be nice to do this depending on content type in HTTP response.

This would be a wonderful filter for proxomitron. After I see the page with the file size, I will decide whether to download it or not and use download manager if yes.

Thank you in advance
I've managed to get this system working!

To set what extensions are matched, you must edit both the !-URL and Content-Disposition filters, the (exe|zip|rar) part.

To set what response codes must be matched before the prompt is shown, you must edit the Content-Length filter, in the URL Match box: ($RESP(200)|$RESP(...))

Code:
[HTTP headers]
In = FALSE
Out = TRUE
Key = "!-URL: File Size System - Set Matched Extensions [ku] (Out)"
URL = "$SET(matchedextension=)((^*=(^http://*.(^([a-z]+{2,4})(^/))))*.(exe|zip|rar))(^?)"
Replace = "\u$SET(matchedextension=1)"

In = TRUE
Out = FALSE
Key = "Content-Disposition: File Size System - Set Matched Extensions [ku] (In)"
Match = "(*filename=$AV(*.(exe|zip|rar)))\0"
Replace = "\0$SET(matchedextension=1)"

In = TRUE
Out = FALSE
Key = "Content-Length: File Size System: Get and Show Size [ku] (In)"
URL = "($RESP(200)|$RESP(...))$TST(matchedextension=1)"
Match = "$IHDR(Content-Length:\1)$SET(matchedextension=)$CONFIRM(The file size of "http://\h\p" is \1 byte(s).\n\nKill the connection?)"
Replace = "\k$ALERT(Connection killed.)"

Enjoy! Smile!

Test it here:

http://dl.google.com/earth/client/brande...h_CZXV.exe

Screenshot of prompt:

[attachment=116]

7,727,880 bytes = 7.37 MB
1 MB = 1,048,576 bytes
7,727,880 bytes / 1,048,576 bytes = 7.37 MB
Reference URL's