Read Only CSV file?

I am using the QueryToCSV solution documented in Ben Nadel's blog below to generate a CSV file in CF9. I have a requirement to generate a read-only file. Is there a relative easy way to add a read-only attribute to a CSV file?

http://www.bennadel.com/blog/1239-Updated-Converting-A-ColdFusion-Query-To-CSV-Using-QueryToCSV-.htm

Thanks
LVL 18
Jerry MillerAsked:
Who is Participating?
 
_agx_Connect With a Mentor Commented:
The comments in this thread supports the "not possible with file downloads" theory. (CF is basically a java servlet, so the same rules apply: )

You can't do that. The client does what he wants with the stream of bytes that the servlet sends. He can choose to cancel save it as a file, to ignore it, to save it with another name, anything. You won't gain access to the client machine from the server.

In other words, there's no way you can force a file download to be read-only.
0
 
_agx_Connect With a Mentor Commented:
If you're saving it on the server, you can use

       FileSetAttribute("c:\path\to\yourFile.csv", "readOnly")

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-6d00.html
0
 
Jerry MillerAuthor Commented:
I am trying to avoid saving files on the server. That is why I need to set the attribute on creation if possible.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
_agx_Commented:
Hm.. are you talking about a file download? If so, afaik you can't do that.
0
 
Jerry MillerAuthor Commented:
I was afraid of that. I haven't yet been told that it is a requirement, but I am anticipating the questions once they see the 'save as box'.

Thanks for the help.
0
 
_agx_Commented:
Glad I could help ...  though sorry I didn't have better news :/ Unfortunately once you serve up a file for downloading it's pretty much out of your control.  Users can do whatever they want with it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.