def downLoadFile( dbid, rid, fid, vid = "0" )

      @dbid, @rid, @fid, @vid = dbid, rid, fid, vid

      @downLoadFileURL = "http://#{@org}.#{@domain}.com/up/#{dbid}/a/r#{rid}/e#{fid}/v#{vid}"
      
      if @useSSL
         @downLoadFileURL.gsub!( "http:", "https:" )
      end

      @requestHeaders = { "Cookie"  => "ticket=#{@ticket}" }

      if @printRequestsAndResponses
         puts
         puts "downLoadFile request: -------------------------------------"
         p @downLoadFileURL
         p @requestHeaders
      end

      begin

         if USING_HTTPCLIENT
            @responseCode = 404
            @fileContents = @httpConnection.get_content( @downLoadFileURL, nil, @requestHeaders ) 
            @responseCode = 200 if @fileContents
         else  
            @responseCode, @fileContents = @httpConnection.get( @downLoadFileURL, @requestHeaders )
         end
    
      rescue Net::HTTPBadResponse => @lastError
      rescue Net::HTTPHeaderSyntaxError => @lastError
      rescue StandardError => @lastError
      end

      if @printRequestsAndResponses
         puts
         puts "downLoadFile response: -------------------------------------"
         p @responseCode
         p @fileContents
      end

      return self if @chainAPIcalls
      return @responseCode, @fileContents
    end
def downLoadFile( dbid, rid, fid, vid = "0" )

      @dbid, @rid, @fid, @vid = dbid, rid, fid, vid

      @downLoadFileURL = "http://#{@org}.#{@domain}.com/up/#{dbid}/a/r#{rid}/e#{fid}/v#{vid}"
      
      if @useSSL
         @downLoadFileURL.gsub!( "http:", "https:" )
      end

      @requestHeaders = { "Cookie"  => "ticket=#{@ticket}" }

      if @printRequestsAndResponses
         puts
         puts "downLoadFile request: -------------------------------------"
         p @downLoadFileURL
         p @requestHeaders
      end

      begin

         if USING_HTTPCLIENT
            @responseCode = 404
            @fileContents = @httpConnection.get_content( @downLoadFileURL, nil, @requestHeaders ) 
            @responseCode = 200 if @fileContents
         else  
            @responseCode, @fileContents = @httpConnection.get( @downLoadFileURL, @requestHeaders )
         end
    
      rescue Net::HTTPBadResponse => @lastError
      rescue Net::HTTPHeaderSyntaxError => @lastError
      rescue StandardError => @lastError
      end

      if @printRequestsAndResponses
         puts
         puts "downLoadFile response: -------------------------------------"
         p @responseCode
         p @fileContents
      end

      return self if @chainAPIcalls
      return @responseCode, @fileContents
    end
Download a file's contents from a file attachment field in QuickBase.
 You must write the contents to disk before a local file exists.