Re: [WebDNA] directory protection questions
This WebDNA talk-list message is from 2008
It keeps the original formatting.
numero = 100251
interpreted = N
texte = ------=_Part_10635_16308292.1215450670747Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 7bitContent-Disposition: inlineTerry,I've been looking to do something similar. I have been playing around withthe following to download a file called 'tab.png'. The test urls areDirect to imagehttp://www.revolutionaries.ie/testspace/secure/tab.pngWebDNA template forcing downloadhttp://www.revolutionaries.ie/testspace/test.tmplSeems to work on Safari and FireFox. The WebDNA template could then checkfor a cookie etc before executing the download script.- Tomhtaccess in folder to be protectedAuthType BasicAuthName "Restricted Stuff"Options ExecCGIWebDNA template in containing folder[!][/!][text]exportFilePath=secure/[/text][text]exportFile=tab.png[/text][text]line_ending=%0D%0A[/text][returnRaw binarybody=[exportFilePath][exportFile]]HTTP/1.0 200OK[unurl][line_ending][/unurl][!][/!]Status: 200[unurl][line_ending][/unurl][!][/!]Content-Type: application/octet-stream[unurl][line_ending][/unurl][!][/!]Content-Disposition: attachment;filename="[exportFile]"[unurl][line_ending][line_ending][/unurl][!][/!][/returnraw]------=_Part_10635_16308292.1215450670747Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: 7bitContent-Disposition: inlineTerry,
I've been looking to do something similar. I have been playing around with the following to download a file called 'tab.png'. The test urls are
Direct to image
http://www.revolutionaries.ie/testspace/secure/tab.pngWebDNA template forcing download
http://www.revolutionaries.ie/testspace/test.tmplSeems to work on Safari and FireFox. The WebDNA template could then check for a cookie etc before executing the download script.
- Tom
htaccess in folder to be protected
AuthType Basic
AuthName "Restricted Stuff"
Options ExecCGIWebDNA template in containing folder
[!]<!-- HAS_WEBDNA_TAGS -->
[/!]
[text]exportFilePath=secure/[/text]
[text]exportFile=tab.png[/text]
[text]line_ending=%0D%0A[/text]
[returnRaw binarybody=[exportFilePath][exportFile]]HTTP/1.0 200 OK[unurl][line_ending][/unurl][!]
[/!]Status: 200[unurl][line_ending][/unurl][!]
[/!]Content-Type: application/octet-stream[unurl][line_ending][/unurl][!]
[/!]Content-Disposition: attachment; filename="[exportFile]"[unurl][line_ending][line_ending][/unurl][!]
[/!][/returnraw]
------=_Part_10635_16308292.1215450670747--
Associated Messages, from the most recent to the oldest:
------=_Part_10635_16308292.1215450670747Content-Type: text/plain; charset=UTF-8Content-Transfer-Encoding: 7bitContent-Disposition: inlineTerry,I've been looking to do something similar. I have been playing around withthe following to download a file called 'tab.png'. The test urls areDirect to imagehttp://www.revolutionaries.ie/testspace/secure/tab.pngWebDNA template forcing downloadhttp://www.revolutionaries.ie/testspace/test.tmplSeems to work on Safari and FireFox. The WebDNA template could then checkfor a cookie etc before executing the download script.- Tomhtaccess in folder to be protectedAuthType BasicAuthName "Restricted Stuff"Options ExecCGIWebDNA template in containing folder
[!][/!]
[text]exportFilePath=secure/[/text]
[text]exportFile=tab.png[/text]
[text]line_ending=%0D%0A[/text][returnRaw binarybody=[exportFilePath][exportFile]]HTTP/1.0 200OK
[unurl][line_ending][/unurl]
[!][/!]Status: 200
[unurl][line_ending][/unurl]
[!][/!]Content-Type: application/octet-stream
[unurl][line_ending][/unurl]
[!][/!]Content-Disposition: attachment;filename="[exportFile]"
[unurl][line_ending][line_ending][/unurl]
[!][/!][/returnraw]------=_Part_10635_16308292.1215450670747Content-Type: text/html; charset=UTF-8Content-Transfer-Encoding: 7bitContent-Disposition: inlineTerry,
I've been looking to do something similar. I have been playing around with the following to download a file called 'tab.png'. The test urls are
Direct to image
http://www.revolutionaries.ie/testspace/secure/tab.pngWebDNA template forcing download
http://www.revolutionaries.ie/testspace/test.tmplSeems to work on Safari and FireFox. The WebDNA template could then check for a cookie etc before executing the download script.
- Tom
htaccess in folder to be protected
AuthType Basic
AuthName "Restricted Stuff"
Options ExecCGIWebDNA template in containing folder
[!]<!-- HAS_WEBDNA_TAGS -->
[/!]
[text]exportFilePath=secure/[/text] [text]exportFile=tab.png[/text]
[text]line_ending=%0D%0A[/text]
[returnRaw binarybody=[exportFilePath][exportFile]]HTTP/1.0 200 OK[unurl][line_ending][/unurl][!]
[/!]Content-Type: application/octet-stream[unurl][line_ending][/unurl][!]
[/!]Content-Disposition: attachment; filename="[exportFile]"[unurl][line_ending][line_ending][/unurl][!]
[/!][/returnraw]
------=_Part_10635_16308292.1215450670747--
"Tom Duke"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
For those of you not on the WebCatalog Beta... (1997)
wc 2 pro users - sites, quotes wanted (1997)
[redirect] question (2005)
[quantity] and quantity[lineindex] (2000)
Permission denied? (2004)
WebCommerce: Folder organization ? (1997)
Re:Has this happened to you? (was:Emailer Chokes on bad address) (1997)
I've been thinking (2002)
WebCat2b12 CGI Mac -- Problems propagating the cart through frames...still (1997)
Capitalize (2003)
Locking up with WebCatalog... (1997)
Verifying and adding new users (1997)
Using Plug-In while running 1.6.1 (1997)
PCS Frames (1997)
Trigger options (2000)
two unique banners on one page (1997)
4.0.2b4 (2000)
Multiple Newcarts (1996)
New Cart No. on same page (2003)
Help! (2000)