{"action":"created","issue":{"url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/15","labels_url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/15/comments","events_url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/15/events","html_url":"https://github.com/cloudinary/cloudinary_ios/issues/15","id":62503165,"number":15,"title":"Upload image with Server signature crash","user":{"login":"stefanocdn","id":4325983,"avatar_url":"https://avatars.githubusercontent.com/u/4325983?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanocdn","html_url":"https://github.com/stefanocdn","followers_url":"https://api.github.com/users/stefanocdn/followers","following_url":"https://api.github.com/users/stefanocdn/following{/other_user}","gists_url":"https://api.github.com/users/stefanocdn/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanocdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanocdn/subscriptions","organizations_url":"https://api.github.com/users/stefanocdn/orgs","repos_url":"https://api.github.com/users/stefanocdn/repos","events_url":"https://api.github.com/users/stefanocdn/events{/privacy}","received_events_url":"https://api.github.com/users/stefanocdn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-17T19:57:45Z","updated_at":"2015-03-17T20:13:00Z","closed_at":null,"body":"Hi I am getting this error when trying to upload a picture from IOS:\r\n\r\nInvalid Signature 8cd27f15e344fe337f6099afbb09dd2e96f8ecff. String to sign - 'public_id=888f0cf0-0d93-4017-87cc-0356c79d20f8&timestamp=1426595637'\r\n\r\nMy server side code for generating the signature is:\r\n\r\noptions = [{height: 800, width: 800, crop: :limit}]\r\nresult = Cloudinary::Utils.generate_transformation_string(options)\r\ntime = Time.now.to_i\r\npublic_id = SecureRandom.uuid\r\napi_key = Cloudinary.config.api_key\r\nsignature = Cloudinary::Utils.api_sign_request({public_id: public_id, timestamp: time, transformation: result}, Cloudinary.config.api_secret)\r\nrender status: 200, json: {\r\n     signature: signature,\r\n     public_id: public_id,\r\n     timestamp: time,\r\n     api_key: api_key,\r\n     cloud_name: \"mycloudname\"\r\n   }\r\n\r\nMy server response is:\r\n\r\n{\r\n    \"api_key\" = mycloudapikey;\r\n    \"cloud_name\" = mycloudname;\r\n    \"public_id\" = \"888f0cf0-0d93-4017-87cc-0356c79d20f8\";\r\n    signature = 8cd27f15e344fe337f6099afbb09dd2e96f8ecff;\r\n    timestamp = 1426595637;\r\n}\r\n\r\nI use this dictionary as options for my upload to cloudinary. But I can't add the transformation that matches the one server-side in the options dictionary because:\r\n\r\nIn the upload method:\r\n\r\n- (void)upload:(id)file options:(NSDictionary *)options withCompletion:(CLUploaderCompletion)completionBlock andProgress:(CLUploaderProgress)progressBlock\r\n{\r\n    [self setCompletion:completionBlock andProgress:progressBlock];\r\n    if (options == nil)options = @{};\r\n    NSMutableDictionary *params = (NSMutableDictionary *)[self buildUploadParams:options];\r\n    [self callApi:@\"upload\" file:file params:params options:options];\r\n}\r\n\r\nWhen the following is called\r\n\r\n- (NSDictionary *)buildUploadParams:(NSDictionary *)options\r\n\r\nSince I have a signature, the transformation object is not transformed to a string\r\n\r\nif (options[@\"signature\"] == nil) {\r\n        id transformation = [options cl_valueForKey:@\"transformation\" defaultValue:@\"\"];\r\n        if ([transformation isKindOfClass:[CLTransformation class]]){\r\n            transformation = [((CLTransformation *)transformation)generate];\r\n        }\r\n        [params setValue:transformation forKey:@\"transformation\"];\r\n        NSArray* tags = [CLCloudinary asArray:options[@\"tags\"]];\r\n        [params setValue:[tags componentsJoinedByString:@\",\"] forKey:@\"tags\"];\r\n        NSArray* allowedFormats = [CLCloudinary asArray:options[@\"allowed_formats\"]];\r\n        [params setValue:[allowedFormats componentsJoinedByString:@\",\"] forKey:@\"allowed_formats\"];\r\n        [params setValue:[self buildContext:options[@\"context\"]] forKey:@\"context\"];\r\n        [params setValue:[self buildFaceCoordinates:options[@\"face_coordinates\"]] forKey:@\"face_coordinates\"];\r\n        [params setValue:[self buildEager:options[@\"eager\"]] forKey:@\"eager\"];\r\n        [params setValue:[self buildCustomHeaders:options[@\"headers\"]] forKey:@\"headers\"];\r\n    } else {\r\n        [params setValue:options[@\"transformation\"] forKey:@\"transformation\"];\r\n        [params setValue:options[@\"tags\"] forKey:@\"tags\"];\r\n        [params setValue:options[@\"allowed_formats\"] forKey:@\"allowed_formats\"];\r\n        [params setValue:options[@\"context\"] forKey:@\"context\"];\r\n        [params setValue:options[@\"face_coordinates\"] forKey:@\"face_coordinates\"];\r\n        [params setValue:options[@\"eager\"] forKey:@\"eager\"];\r\n        [params setValue:options[@\"headers\"] forKey:@\"headers\"];\r\n    }\r\n\r\nSo when this method is called\r\nNSURLRequest *req = [self request:apiUrl params:params file:file];\r\n\r\nNSMutableData* postBody = [NSMutableData data];\r\n    for (NSString* param in [params allKeys]){\r\n        NSObject* value = [params valueForKey:param];\r\n        if ([value isKindOfClass:[NSArray class]]) {\r\n            NSArray *arrayValue = (NSArray*) value;\r\n            for (NSString *paramValue in arrayValue) {\r\n                [self encodeParam:postBody param:[param stringByAppendingString:@\"[]\"] paramValue:paramValue boundary:boundary];\r\n            }\r\n        } else {\r\n            NSString *paramValue = [CLCloudinary asString:value];\r\n            if ([paramValue length] == 0) continue;\r\n            [self encodeParam:postBody param:param paramValue:paramValue boundary:boundary];\r\n        }\r\n    }\r\n\r\nNSString *paramValue = [CLCloudinary asString:value];\r\n\r\nThe asString called on the transformation crashes.\r\n\r\nHow can I solve that?"},"comment":{"url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/comments/82577671","html_url":"https://github.com/cloudinary/cloudinary_ios/issues/15#issuecomment-82577671","issue_url":"https://api.github.com/repos/cloudinary/cloudinary_ios/issues/15","id":82577671,"user":{"login":"TalLevAmi","id":66755,"avatar_url":"https://avatars.githubusercontent.com/u/66755?v=3","gravatar_id":"","url":"https://api.github.com/users/TalLevAmi","html_url":"https://github.com/TalLevAmi","followers_url":"https://api.github.com/users/TalLevAmi/followers","following_url":"https://api.github.com/users/TalLevAmi/following{/other_user}","gists_url":"https://api.github.com/users/TalLevAmi/gists{/gist_id}","starred_url":"https://api.github.com/users/TalLevAmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TalLevAmi/subscriptions","organizations_url":"https://api.github.com/users/TalLevAmi/orgs","repos_url":"https://api.github.com/users/TalLevAmi/repos","events_url":"https://api.github.com/users/TalLevAmi/events{/privacy}","received_events_url":"https://api.github.com/users/TalLevAmi/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T20:13:00Z","updated_at":"2015-03-17T20:13:00Z","body":"Looks like is that server is not returning the transformation parameter in it's JSON."}}