cloudinary_ios: Signed request error (timestamp=1)
I am trying to use Safe mobile request to upload image.
let config = CLDConfiguration(cloudName: request.cloudName, apiKey: request.apiKey, apiSecret: nil)
let cloudinary = CLDCloudinary(configuration: config)
let signature = CLDSignature(signature: request.signature, timestamp: NSNumber(value: request.timestamp))))
let params = CLDUploadRequestParams()
params.setSignature(signature)
params.setParam("api_key", value: request.apiKey)
params.setPublicId(request.publicId)
cloudinary.createUploader().signedUpload(data: data, params: params, progress: nil) { (result, error) in
print(error)
}
And getting error:
Invalid Signature <my signature>. String to sign - 'public_id=<my public id>×tamp=1
As I can see, there is a problem with timestamp parameter sending.
Because I create CLDSignature object with correct timestamp and signature.
But in CLDNetworkDelegate on multipart request forming the timestamp parameter is being recognized as Bool. And it turns to 1 instead of 1485214919, for example.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 25 (3 by maintainers)
I re-created what I used to have so I can better explain to you 😃 Essentially you want to create the
CLDUploadRequestParamsusing exactly the params that your server sends, with the addition thattimestampis aStringrather thanInt.This is my guess (under the Upload tab of Settings):
Though it kind of sounds like Cloudinary is still not recognizing your upload as a “signed” upload. Did you set
signatureas a parameter?