I've created a reporting application on Railo. The last step of this is to allow the users to download their reports. For this, they click on a link which takes them to /download.cfm?report=reportid
The download page is just
<cfdocument format="pdf" saveAsName="Report.pdf">
<!-- html for report here -->
</cfdocument>
This should be ideally showing a save file dialog with "Report.pdf" in the default file name. However, it still shows "download.cfm"
Any idea what I am overlooking / how to make the save file dialog show "Report.pdf"?
Try manually setting the content disposition header:
<cfheader name="content-disposition" value="attachment; filename=Report.pdf">
Related
I am having problem with content editor, I am using tool bar of content editor to generate hyperlinks, following is my HTML
<li>w</li>
<li>a</li>
<li>awealth</li>
<li>wwealth</li>
<li>ds</li>
some items are successfully linked to appropriate files but some links are rendered as they are and when i click on them i see page not found. IDs are valid, I have verified.
What could be the reason, Why some links aren't converted to links to actual files? Any other way to use content editor?
You need to render the field using Sitecore Controls:
<sc:Text runat="server" field="MyFieldName" />
sc:Text derives from the FieldRenderer.
You should consider reading http://sdn.sitecore.net/upload/sitecore6/64/presentation_component_api_cookbook_sc64-a4.pdf (sc:Text is used on page 36)
For this code:
page1.cfm
<form action="page2.cfm" method="post">
<input type="text" name="name" />
<input type="submit" />
</form>
page2.cfm
<cfset session.name = form.name>
<cflocation url="page3.cfm" addtoken="no">
page3.cfm
<cfdump var="#session.name#">
If you do this:
browse to page1.cfm on any browswer
submit the form with "value1"
open a new tab
browse to page1.cfm and submit the form with "value2"
go back to the first tab and refresh the page
You will notice that the value of session.name changes on the first tab.
In this question, one of the answers is followed by the comment, "If tabbed browsing causes issue with your session variables, you are doing it wrong".
How then, do you do it properly? The objective is to preserve "value1" on the first tab and "value2" on the second.
Hopefully Scott will post his own comment/answer here but I suspect you misinterpreted his comment. What you describe here is exactly how browsing has always worked for me. Before "tabbed" browsing existed this same issue arose when you opened a new browser window without closing the existing one (this happens no matter how many browser windows you open and still happens today). The ColdFusion server will only maintain a single session for every browser instance the user has open. Hence the warning that all of us display when a user logs out of a session based application. Something along the lines of "your session will not be completely closed until you exit all of your browser windows". Or when they log in "you already have an active session, your other session will be terminated". Then came tabbed browsing. Well tabs are nothing more than another browser instance, just like before, only contained within the same window.
So tabbed browsing does not cause an issue with session variables, they are working as designed. This is how it works. This is expected behavior. It is your expectation that is wrong. I am sure there are ways to make it work the way you are expecting, like there always is in programming, but that is going against the way browsers are designed. Is that a direction you really want to go?
Duplicate question - How to differ sessions in browser-tabs?. You will see some examples there but they are all hacks in an attempt to make it work differently than designed.
I am trying to install firebug lite onto IE and Chrome. The documentation states to simply add the javascript location in the document and all should be well. This works but the iframe containing then firebug is hidden with a visibility: hidden attribute. I am unable to find anywhere to actually activate the firebug, normally you would think you could right click and "inspect" but that option is not there. The chrome extension and bookmarklet works but my main concern is trying to firebug through internet explorer.
Anyone had or solved this issue?
Yeah I had the same problem using the stable channel. I switched to the debug channel & it worked perfectly, opening right up. So use this:
<script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script>
Also, I find it useful to throw a quick 300px-high div in there at the bottom of my page to make room for Firebug Lite, like this:
<div style="display:block; height:300px; background:blue;"></div>
Just don't forget to remove it with the FBL script tag!
I'm running a loop to build multiple PDFs. The background colors of pdf 2+ created in the loop just plain disappear. Doesn't matter if the background color is defined in CSS, as an HTML style, using hex code or just a color name.
This is not an issue if I were to create 2 pdfs in a row without a loop.
Any idea what gives?
This is a bug, it only effects cfdocument saved in memory, it does not effect cfdocuments that are displayed directly to the browser. If you have to save your document in memory, the workaround is pretty simple; use an include or cfc.
myDocument.cfm
<cfdocument name = "myDoc">
...
...
</cfdocument>
myLoop.cfm
<cfloop ...>
<cfinclude template= "myDocument.cfm">
</cfloop>
I mention this bug and workaround here: cfdocument prevent page breaks mid-row
I keep getting this "Element TSHIRTOPTION is undefined in Form" Error when page first loads up. The radio button values work when I click on each one. When I refresh the browser, error doesnt appear again until I click on link again (like when the page loads up the first time). I have one of the radio buttons "preselected" hoping to solve the undefined error, but no help there. Any suggestions?
A couple of things could be happening here:
your query is running before the form is submitted - make sure your UPDATE only executes after the form is submitted run query
you are trying to use the form.TshirtOption variable before it is defined as in the radio button itself:
<cfif form.TshirtOption is "radio"><cfset checked = 'checked="checked"'/></cfif>
<input name="radio" type="radio" id="radio" value="radio" #checked# />
OR - you are trying to use the variable out of scope i.e. form.TshirtOption vs TshirtOption
we might need to see your full source, but basically you probably need to give the variable a default before you try to use it:
<cfparam name="form.TshirtOption" value="" />
-sean
Code would be helpful, but I bet a
<cfparam name="form.TSHIRTOPTION " default="your_default_value"/>
at the top of the page would fix you right up. :)