Solved

Read Only CSV file?

Posted on 2013-01-08
6
712 Views
Last Modified: 2013-01-08
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
0
Comment
Question by:Jerry Miller
  • 4
  • 2
6 Comments
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 500 total points
ID: 38756567
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
 
LVL 18

Author Comment

by:Jerry Miller
ID: 38756651
I am trying to avoid saving files on the server. That is why I need to set the attribute on creation if possible.
0
 
LVL 52

Expert Comment

by:_agx_
ID: 38756791
Hm.. are you talking about a file download? If so, afaik you can't do that.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 38756833
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
 
LVL 18

Author Comment

by:Jerry Miller
ID: 38756869
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
 
LVL 52

Expert Comment

by:_agx_
ID: 38756881
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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now