CFHTTP get as binary problems

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFHTTP get as binary problems

    I'm trying to pull a series of images off a remote server for manipulation and
    cfhttp won't save multiple files. The first call to save works fine, but
    subsequent calls on the same page fail

    <CFLOOP ... over the file list to pull >

    <!--- Pull the image for manipulation & save in a temp DIR --->
    <cfhttp
    url = #imgURL#
    method = "get"
    redirect = "yes"
    timeout = "30"
    getasbinary = "yes"
    path = "c:\Temp">
    </cfhttp>
    <!--- Testing only --->
    <CFOUTPUT><HR>request for #imgURL# returned statusCode:
    #cfhttp.statusCode#<HR></CFOUTPUT>
    bigreddastud Guest

  2. Similar Questions and Discussions

    1. CFHTTP
      Hello, I need to send data from a CF page to an asp.net page for processing via a URL string. The ASP page takes three parameters. Those being...
    2. CFHTTP posts before CF MX 6.0
      Thank you for taking the time to view my post. I am caught with working on a project where my friend is running ColdFusion 5 on her server and...
    3. CFHTTP Issue
      Can someone else please try the below code? When I run the below code, I get "404 not found." I am able to reach this site on the server. Here's...
    4. CFHTTP help
      We have an in-house built publication system that creates .htm files from database content. For a specific project, I need to modify the way that...
    5. 64 bit binary and 32 bit binary have different result. Is it library bug or compiler bug?
      #include <errno.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <dirent.h> #include <assert.h> int main(int argc, char...
  3. #2

    Default Re: CFHTTP get as binary problems

    It looks like if you don't specify the cfhttp "file" attribute, it uses the
    name of the 1st file and then just keeps overwriting that same file. Try this.




    <CFLOOP ... over the file list to pull >

    <!--- Pull the image for manipulation & save in a temp DIR --->
    <cfhttp
    url = #imgURL#
    method = "get"
    redirect = "yes"
    timeout = "30"
    getasbinary = "yes"
    path = "c:\Temp"
    file="#imgURL#">
    </cfhttp>
    <!--- Testing only --->
    <CFOUTPUT><HR>request for #imgURL# returned statusCode:
    #cfhttp.statusCode#<HR></CFOUTPUT>
    BSterner Guest

  4. #3

    Default Re: CFHTTP get as binary problems

    Hmm.
    Well, dynamically supplying the 'File' attribute in the CFHTTP call as
    suggested above worked.

    Funny thing is that it wasn't actually saving over the same file on
    subsequent calls. If that were the case, I'd have ended up with the image in
    the temp dir that didn't have the correct matching name (i.e. the last actual
    image contents would be named the first image's name).

    Either way, from the CFML reference, it should be saving the
    cfhttp.fileContents the default of THAT CALL, not the first on the page or
    loop. That's a bug IMO.

    Thanks for the code tweak fix, I can work with that!

    bigreddastud Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139