While uploading the image of too small size e.g when i crop the image Transloadit server always reply with this response.
{"error":"FILE_FILTER_DECLINED_FILE","message":"One of your files was declined","reason":"file_0"}
I also tried testing response by adding STEP in the ASSEMBLY with force_accept parameter considering(hoping) that it will accept any file size. But still getting the same response.
Here is the code snippet :
Transloadit *transloadit = [[Transloadit alloc]init:TRANSLOADIT_API_KEY];
AssemblyBuilder *assembly = [[AssemblyBuilder alloc]init];
[assembly setTemplateID:TRANSLOADIT_TEMPLATE_ID];
NSData *imgData = UIImageJPEGRepresentation(imageToUpload, 1.0f);
NSError* error;
//Add a file to be uploaded with autogenerated key
[assembly addFile:imgData withError:error];
if(error!=nil)
TRANSLOADIT_LOG_ERROR(self.class,error);
NSObject<IStep>* step=[[Step alloc] init];
[step setOptionKey:@"robot" object:@"/image/resize"];
[step setOptionKey:@"width" object:@(75)];
[step setOptionKey:@"height" object:@(75)];
[step setOptionKey:@"resize_strategy" object:@"pad"];
[step setOptionKey:@"background" object:@"#000000"];
[step setOptionKey:@"force_accept" object:[NSNumber numberWithBool:YES]];
//Add the step to the assembly
[assembly addStepName:@"thumb" step:step];
//Invoke assembly, and wait for the result
TransloaditResponse* response =[transloadit invokeAssembly:assembly withError:error];
if(error!=nil)
{
TRANSLOADIT_LOG_ERROR_WITH_MESSAGE(self.class,@"Error has occured while completing assembly");
}
if([response isSuccess])
{
// success code
}
else
{
// failure code
}
If someone can help me. Thanks :)