Giter Site home page Giter Site logo

ios-cloudfiles's People

Contributors

axelrivera avatar greenisus avatar jnoller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-cloudfiles's Issues

CDN Url

How do I get the CDN Url after uploading a file?! Thanks

Im using the code:

[self.container uploadObject:o success:^{
self.object = o;
NSLog(@"%@", o.description);
} failure:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
[self stopWaiting];
}];

RSStorageObject URL

Hi,

I'm using rackerlabs/ios-cloudfiles github repository code on my Objective-C project. I'm able to authenticate, list containers and list objects. Now, I have the exact RSStorageObject I want. How can I get this RSStorageObject URL?!

I have a container name in mind and I want to list all url of all objects inside that container. The code below is the best way?

RSClient *client = [[RSClient alloc] initWithProvider:RSProviderTypeRackspaceUS username:@"XXXX" apiKey:@"XXX"];



[client authenticate:^{



    [client getContainers:^(NSArray *objects, NSError *jsonError) {



        for (RSContainer *containerObj in objects) {



            [client getContainerMetadata:containerObj success:^{



                if ([[containerObj name] isEqualToString:@"MYCONTAINER"]) {



                    [containerObj getObjects:^(NSArray *objects, NSError *jsonError) {



                        for (RSStorageObject *storageObj in objects) {



                            // HOW CAN I GET THE URL OF THIS RSStorageObject ???

Thank you!!!!!

RSClient network call is iOS 5 only

The call to +[NSURLConnection sendAsynchronousRequest:queue:completionHandler:] in RSClient.m:154 is only avail in iOS 5.

I've tested this on a 4.3 device and it crashes. Here's the 4.3 - 5.0 diff doc:

https://developer.apple.com/library/ios/#releasenotes/General/iOS50APIDiff/

and the actual iOS SDK doc for the selector:

https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html#//apple_ref/occ/clm/NSURLConnection/sendAsynchronousRequest:queue:completionHandler:

Property content_type of RSStorageObject not being used?

Hi there, I was uploading images to Cloud Files and was setting the content_type property on RSStorageObject to "image/jpg" but when I view the file in the dashboard at manage.rackspacecloud.com the Type is set to "application/json".
It appears to me that the Content-Type header is not being set in

- (NSURLRequest *)uploadObjectRequest:(RSStorageObject *)object

of RSContainer.m.

Should this line be there?

[request addValue:$S(@"%@", object.content_type) forHTTPHeaderField:@"Content-Type"];

After I added it and uploaded the file I observe that the Type is then set to "application/json, image/jpg" which is an improvement as it caused Chrome to attempt to render the image as a json file but it'd be great if the "application/json" content type weren't added.

metadata for uploadObject in RSContainer gives error

If you upload a object with meta data it gives a 400 error.

The following line in RSContainer.m need so be fixed

73: [request addValue:[object.metadata valueForKey:key] forHTTPHeaderField:$S(@"X-Object-Meta-%@", key)];

(add the %@ that is missing)

Use cocoapods

It would be great if i could add this library by just adding it to my Podfile

Unable to create new objects...

So, I'm using the RackSpaceCloudFiles unit tests logic (pretty much identical logic) to essentially do the following:

  1. Authenticate User
  2. Create Container
  3. CDN Enable Container
  4. Create Object in Container.

Steps 1-3 work just fine, and if I login my admin panel, I can see the container, and see that it is CDN enabled.

However, when I try to create an image to upload (or any test file), I never see anything happen. The success handler never completes. The failure handler never completes...it just stops doing anything. My code continues to run no problem.

With that said, if I run the RackSpace unit tests, everything works perfectly. The sample file is created and uploaded...and I can see it in my admin panel.

Here is my logic, just wondering if anything seems blatantly wrong? The code is kicked off with a call to [self uploadImage]

Thanks in advance.

# pragma mark - RackspaceCloud Files logic # if !TARGET_IPHONE_SIMULATOR - (void)createContainer:(void (^)(RSContainer *))successHandler {

self.rsContainer = [[RSContainer alloc] init];
self.rsContainer.name = self.user.userId;

[self.rsClient createContainer:self.rsContainer success:^{
successHandler(self.rsContainer);
} failure:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
NSLog(@"Failed to create container: %@", self.rsContainer.name);
}];
}

  • (void)cdnEnableContainer:(void (^)(RSCDNContainer *))successHandler {

    if (self.rsContainer) {
    [self.rsClient cdnEnableContainer:self.rsContainer success:^(RSCDNContainer *cdnContainer) {
    if (self.rsCDNContainer) {
    NSLog(@"CDN URL: %@", self.rsCDNContainer.cdn_uri.absoluteString);
    self.user.imageUrl = self.rsCDNContainer.cdn_uri.absoluteString;
    }
    successHandler(cdnContainer);
    } failure:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
    NSLog(@"Failed to create CDN Enabled Container: %@", self.rsCDNContainer.name);
    }];
    }

}

  • (void)createObject:(void (^)(RSStorageObject *))successHandler {

    self.rsObject = [[RSStorageObject alloc] init];
    self.rsObject.name = [NSString stringWithFormat:@"%@_profile.png",self.user.userId];
    self.rsObject.content_type = @"image/png";
    self.rsObject.data = UIImagePNGRepresentation(self.profileImageView.image);

    [self.rsContainer uploadObject:self.rsObject success:^{
    successHandler(self.rsObject);
    } failure:^(NSHTTPURLResponse *response, NSData *data, NSError *error) {
    NSLog(@"Failed to create object: %@",self.rsObject.name);
    }];

}

  • (void)uploadImage
    {

    //Let's try to save this image out to the server
    self.rsClient = [[RSClient alloc] initWithProvider:RSProviderTypeRackspaceUS username:@"username" apiKey:@"apikey"];

    [self createContainer:^(RSContainer *c) {
    [self createObject:^(RSStorageObject *o) {
    [self cdnEnableContainer:^(RSCDNContainer *cdnContainer) {
    if (self.rsCDNContainer)
    NSLog(@"CDN Url: %@",self.rsCDNContainer.cdn_uri);
    }];
    }];
    }];
    }

NOTICE: This repo is moving.

On the morning of Saturday, March 23, 2013, the 'rackspace' organization on GitHub will be reorganized. All repos will be moved to the new 'rackerlabs' organization, except for those that are designed to be used by Rackspace customers and which are fully supported.

Please update any links to this repo to reflect the new location within GitHub. For example, if the link to your repo is 'https://github.com/rackspace/foo', you need to change it to 'https://github.com/rackerlabs/foo'.

How to use within a project

I'm interested in uploading files from my application, directly to my rack-space instance. I'm wondering if that would be an appropriate use of this or if deploying an application that uses the rackspace api key would be a bad practice

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.