Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

ColdFusion CFHTTPPARAM Content-Type?

$
0
0

I am attempting to upload a file using the Dropbox API.  Dropbox requires Contact-Type = "application/octet-stream", which I am tried to set in the cfhttpparam type = "header".  However when I post the data to the API.  I get an error stating: Bad HTTP "Content-Type" header: "application/octet-stream,multipart/form-data; boundary=-----------------------------7d0d117230764".  I am guessing that when a cfhttpparam type = "file" is included, the content-type is modified to also include multipart/form-data.  The api will not accept this content-type.  Is there a way to avoid this behavior?  This is the code I am using to attempt the upload.  Thank you.

 

<cfhttp method="post" url="https://content.dropboxapi.com/2/files/upload" result="uploadFile">

  <cfhttpparam type="header" name="Authorization" value="Bearer #DropboxAccessToken#">

  <cfhttpparam type="header" name="Dropbox-API-Arg" value="#serializeJSON(stFields)#">

  <cfhttpparam type="header" name="Dropbox-API-Select-User" value="#DropboxMemberID#">

  <cfhttpparam type="header" name="Content-Type" value="application/octet-stream">

  <cfhttpparam type="file" name="1_1036.gif" file="C:\1_1036.gif">

</cfhttp>


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>