Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Date Date
Qty:
Subtotal
Promotions
Estimated Shipping
VAT
Calculated at checkout
Total
Checkout
ColdFusion Help / 

Hot Fix for Google and YouTube API (ColdFusion 7 and 8)

Adobe Community Help


Products Affected

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Issue

Google offers developers an API to allow you to work with all the different Google services, including the video service from YouTube. Recent changes to the API allows you to authenticate and interact with all their services. To support these changes, Adobe ColdFusion added a new attribute called multiparttype to the cfhttp tag.

Note: This TechNote is not meant as documentation for using the Google API. You can find complete API documentation on Google's web site.

To the top

Reason

The cfhttp tag allows for multipart format data with the multipart attribute in cfhttp or by using a header with content type. The issue is that cfhttp tag only uses multipart/form-data while Google and YouTube requires multipart/related. The attached hot fix adds this functionality.

To the top

Solution

Install the ColdFusion Hot Fix

  1. Download and unzip the version of the hot fix you require
    • hf702_72973.zip
    • hf801_72973.zip
  2. Open the ColdFusion MX Administrator and select the System Information page. Next to the Update File field, either:
    • Type in the file path to the hf###-72973.jar file and click Submit.

      Or
    • Select the Browse Button and browse to hf###-72973.jar. Select the file and click apply.
  3. Stop each ColdFusion server you wish to update
  4. Since we have updated the tag attributes we need a new tag definition library
    • Go to each server's ..\WEB-INF\cftags\META-INF directory.
    • Backup the existing taglib.cftld file.
    • Once backed up replace the taglib.cftld with the one you just downloaded.

Restart each server updated. The ColdFusion MX hot fix JAR file does not need to be retained after installing it with the ColdFusion Administrator. The file has been copied into the correct location. The hot fix JAR file will appear as a new entry in the System Information list.

Sample ColdFusion Code

The sample code below shows how to authenticate, create the required Atom XML, and upload a video. Upon completion you should see a '201 Created' http code.

All CAPS are the areas that require your Google account and video file data for testing.

<!--- **********************************
		

	    Settings to control request
		

	    *********************************** --->
		

	    <cfsetting requesttimeout="450">
		

	    <cfset videoName = "FULL PATH TO VIDEO">
		

	    <cfset videoFileName = "JUST THE FILE NAME OF VIDEO FILE">
		

	    <!--- Google Keys per user account --->
		

	    <cfset username = "GOOGLEACCOUNTNAME">
		

	    <cfset password = "GOOGLEACCOUNTPASSWORD""/>
		

	    <cfset clientKey = "GOOGLECLIENTKEY"/>
		

	    <cfset devKey = "GOOGLEDEVKEY"/> <!--- **********************************
		

	    End of Settings - No changes required below this line to test this tag.
		

	    *********************************** ---> <!--- **********************************
		

	    Authenticate with Google
		

	    *********************************** --->
		

	    <cfoutput>
		

	    <cfhttp url=https://www.google.com/accounts/ClientLogin method="post" result="result" charset="utf-8">
		

	    <cfhttpparam type="formfield" name="accountType" value="HOSTED_OR_GOOGLE">
		

	    <cfhttpparam type="formfield" name="Email" value="#username#">
		

	    <cfhttpparam type="formfield" name="Passwd" value="#password#">
		

	    <cfhttpparam type="formfield" name="service" value="youtube">
		

	    <cfhttpparam type="formfield" name="source" value="collins">
		

	    </cfhttp> <cfset content = result.filecontent>
		

	    <cfset authdata = structNew()>
		

	    <cfloop index="line" list="#content#" delimiters="#chr(10)#">
		

	    <cfset dtype = listFirst(line, "=")>
		

	    <cfset value = listRest(line, "=")>
		

	    <cfset authdata[dtype] = value>
		

	    </cfloop>
		

	    <!--- **********************************
		

	    End Authenticatation
		

	    *********************************** ---> <!--- **********************************
		

	    Create ATOM XML to pass to YouTube
		

	    *********************************** --->
		

	    <cfsavecontent variable="meta">
		

	    <cfoutput>
		

	    <?xml version="1.0"?>
		

	    <entry xmlns=http://www.w3.org/2005/Atom
		

	    xmlns:media="http://search.yahoo.com/mrss/"
		

	    xmlns:yt="http://gdata.youtube.com/schemas/2007">
		

	    <media:group>
		

	    <media:title type="plain">Test Upload</media:title>
		

	    <media:description type="plain">Test Description</media:description>
		

	    <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">Autos</media:category>
		

	    <media:keywords>Geschke</media:keywords>
		

	    </media:group>
		

	    </entry>
		

	    </cfoutput>
		

	    </cfsavecontent>
		

	    <!--- Write XML to file to be used with upload cfhttp --->
		

	    <cffile action="write" ./meta.xml")#" output="#trim(meta)#" />
		

	    <!--- **********************************
		

	    Send Video and ATOM XML to Google using multipart\related
		

	    *********************************** --->
		

	    <cfset youTubeUploadURL = "http://uploads.gdata.youtube.com/feeds/api/users/default/uploads"/>
		

	    <cfhttp url="#youTubeUploadURL#" result="result" method="POST" timeout="450" multiparttype="related">
		

	    <cfhttpparam type="header" name="Authorization" value="GoogleLogin auth=#authdata.auth#">
		

	    <cfhttpparam type="header" name="X-GData-Client" value="#variables.clientkey#">
		

	    <cfhttpparam type="header" name="X-GData-Key" value="key=#variables.devkey#">
		

	    <cfhttpparam type="header" name="Slug" value="#videoFileName#">
		

	    <cfhttpparam type="file" name="API_XML_Request"
		

	    ./meta.xml")#" mimetype="application/atom+xml">
		

	    <cfhttpparam type="file" name="file"  mimetype="video/quicktime">
		

	    </cfhttp> <!--- View Result --->
		

	    <cfdump var="#result#"/></cfoutput> 
To the top

Additional Information

Troubleshooting

If you see an"Attribute validation error for the http tag" error ,you have not installed the new tag lib definitions to the ColdFusion server. Other ColdFusion Hot Fix TechNotes
  • ColdFusion 8 Hot Fixes
  • ColdFusion MX 7 through ColdFusion MX 7.02 tn_17883
  • ColdFusion MX through ColdFusion MX 6.1 b3a939ce
  • ColdFusion 5 and earlier b9f0ff6c

Keywords: kb406660

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement