Download file in coldfusion and read its content

Posted by Deepak on Stack Overflow See other posts from Stack Overflow or by Deepak
Published on 2010-05-03T18:58:17Z Indexed on 2010/05/03 20:28 UTC
Read the original article Hit count: 404

Filed under:
|

cfhttp with a get to download the files. Does anyone have an example of cfhttp working? Are there special settings that need to be set up on the server side to get this tag to work. When I try the following code:

<CFHTTP
    METHOD = "get"
    URL="http://data.bls.gov/PDQ/servlet/SurveyOutputServlet?series_id=LNU04032231&years_option=specific_years&to_year=2010&from_year=2009&delimiter=comma&output_view&output_format=excelTable"
    path="/Users/Deepak" 
    file="testfile.xls">

Nothing comes back to my computer? How do you get it to pop up the "where do you want to save the file box" dialogue box?

I am submitting a form in coldfusion by hitting this link http://data.bls.gov/PDQ/servlet/SurveyOutputServlet?series_id=LNU04032231&years_option=specific_years&to_year=2010&from_year=2009&delimiter=comma&output_view&output_format=excelTable I am getting a excel file as a result. How can I save this file on my local box. Or, is it possible to directly read the content of file without saving it in my local box through coldfusion using cfftp or cfhttp?

cfhttp.mimeType is application/vnd.ms-excel in this case. Thanks!!

© Stack Overflow or respective owner

Related posts about coldfusion

Related posts about cfhttp