I have this section of code for my app and was wondering how I would be able to add something unique to the end of the file name such as the date so test.png becomes test16102012.png.
[body appendData:[[NSString stringWithFormat:@"Content-Disposition:
form-data; name=\"uploadedfile\"; filename=\"test.png\"\r\n"]
dataUsingEncoding:NSUTF8StringEncoding]];
Thanks
Matt
By using
stringWithFormat:method you can add anything in the string itself.Example:
You can also use random generator(
arc4random) or atimeIntervalSince1970method ofNSDateclass.Hope it helps