You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this issue when debugging my file uploading code. I have a jpg file in the app bundle and has no problem to get the file path using: [[NSBundle mainBundle] pathForResource:@"testImage" ofType:@"jpg"];
But when I call the uploadWithSuccess:failure on my subclass of LBFile object which created as:
the fullLocalPath seems to be wrong. the path returned by NSBundle already included the file name but in the following code the fullLocalPath is assembled with an additional file name at the end. Thus it ends as something like some/path/testImage.jpg/testImage.jpg and NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullLocalPath error:&error]; returns nil.
I fixed this issue in my project by replacing NSString *fullLocalPath = [self.localPath stringByAppendingPathComponent:self.name];
with NSString *fullLocalPath = self.localPath;
in above code snippet and it is working in my case. Should it be an official fix? Has anyone encountered this problem before?
The text was updated successfully, but these errors were encountered:
I found this issue when debugging my file uploading code. I have a jpg file in the app bundle and has no problem to get the file path using:
[[NSBundle mainBundle] pathForResource:@"testImage" ofType:@"jpg"];
But when I call the
uploadWithSuccess:failure
on my subclass of LBFile object which created as:the fullLocalPath seems to be wrong. the path returned by NSBundle already included the file name but in the following code the fullLocalPath is assembled with an additional file name at the end. Thus it ends as something like some/path/testImage.jpg/testImage.jpg and
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:fullLocalPath error:&error];
returns nil.I fixed this issue in my project by replacing
NSString *fullLocalPath = [self.localPath stringByAppendingPathComponent:self.name];
with
NSString *fullLocalPath = self.localPath;
in above code snippet and it is working in my case. Should it be an official fix? Has anyone encountered this problem before?
The text was updated successfully, but these errors were encountered: