kennylerma / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

'contentType' in Batch #345

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Trying to add some images to user album from ByteArray:
var batch:Batch = new Batch();
var albumId:String = 'xxxxxxxxxxxx';
for (var i:int, l:int = fbp.imagesForUploadData.length; i < l; i++) {
    batch.add(
        '/'+albumId+'/photos',
        handleEachImageUloadComplete,
        {
            message:'My photo ' + (i + 1),
            fileName:'FILE_NAME' + i,
            image:imagesForUploadData[i] as ByteArray,
            contentType:'image/jpg'
        },
        URLRequestMethod.POST
    );
}
2. Error: 
TypeError: Error #1009: Не удается вызвать свойство 
или метод со ссылкой на объект "null".
    at com.facebook.graph.utils::PostRequest/writeFileData()[/com/facebook/graph/utils/PostRequest.as:135]
    at com.facebook.graph.net::FacebookBatchRequest/sendPostRequest()[/com/facebook/graph/net/FacebookBatchRequest.as:146]
    at com.facebook.graph.net::FacebookBatchRequest/call()[/com/facebook/graph/net/FacebookBatchRequest.as:122]
    at com.facebook.graph.core::AbstractFacebook/batchRequest()[/com/facebook/graph/core/AbstractFacebook.as:290]
    at com.facebook.graph::Facebook$/batchRequest()[/com/facebook/graph/Facebook.as:452]
    ...

What version of the product are you using? On what operating system?
1.7, MacOS 10.6.8

Please provide any additional information below.
I solved that by adding this lines of code

if (request.params['contentType'] != undefined)
    params.contentType = request.params['contentType'];

into FacebookBatchRequest.as, line 92-93.

Original issue reported on code.google.com by Boatin...@gmail.com on 31 Aug 2011 at 1:42

GoogleCodeExporter commented 9 years ago
Fix has been merged into svn. Thanks!

Original comment by edwar...@gmail.com on 31 Aug 2011 at 5:13