Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8200029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:17:41+00:00 2026-06-07T06:17:41+00:00

Hey i have a mac application with the following code: NSURL *url; url =

  • 0

Hey i have a mac application with the following code:

 NSURL *url;
        url = [NSURL URLWithString:@"http://yfrog.com/api/xauth_upload"];

        ASIFormDataRequest *request = [[[ASIFormDataRequest alloc] initWithURL:url] autorelease];

        [request setDelegate:self];
        [request setUseCookiePersistence:NO];
        [request setUploadProgressDelegate:self];
        [request showAccurateProgress]; 
        [request signRequestWithClientIdentifier:@"w" secret:@"x" tokenIdentifier:@"y" secret:@"z" usingMethod:ASIOAuthHMAC_SHA1SignatureMethod];
        [request setPostValue:@"a" forKey:@"key"];
    NSData *imageData = [[NSData alloc]initWithContentsOfFile:[draggedFilenames objectAtIndex:0]];
    [request setPostValue:imageData forKey:@"media"];

        [request startAsynchronous]; 

But the problem is i always get this response from yfrog servers:

So something is wrong with the image upload. On iPhone it works like this:

[request setData:UIImageJPEGRepresentation(picture, 0.8) withFileName:@"filename.jpg" andContentType:@"image/jpeg" forKey:@"media"];

But this doesn’t work cocoa(mac) because there is no method like UIIMageJPEGRepresentation.
Also the authentication works, this cant be the problem. If you ask you about this method signRequestWithClientIdentifier it is from the asihttprequest+oauth wrapper from here:
https://github.com/keybuk/asi-http-request-oauth

So how can i upload the image correctly ?

Thanks so much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:17:43+00:00Added an answer on June 7, 2026 at 6:17 am
    NSData* NSImageJPEGRepresentation(NSImage* image, CGFloat compressionQuality)
    {
        if(nil == image)return nil;
        NSDictionary *dict;
        dict = [NSDictionary dictionaryWithObjectsAndKeys:
                [NSNumber numberWithFloat:compressionQuality],
                NSImageCompressionFactor,
                nil];
    
        NSBitmapImageRep* imageRep;
        imageRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
        return [imageRep representationUsingType:NSJPEGFileType 
                                      properties:dict];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey i have this talk to do: Use solr api, use this url: http://localhost:8983/solr/select/?q=tree
Hey I have this code right here: http://pastie.org/534470 And on line 109 I get
Hey I have the following code which I'm using to isolate the a b
Hey I have this little javascript bookmark javascript:(function(){ window.open('http://www.mywebsite.com/index.php?currentsite#bookmark'); })() How can I get
Hey - I have the following method on my UITableView controller public void RemoveEventFromList(Event
Hey I have this code but it doesn't work because it is expecting a
Hey i have the foolowing xml file : <?xml version=1.0?> <accidents> <accident> <org>1</org> <com>194</com>
Hey guys have her an code where i add an option to a html
Hey I have this code that sends an email with some data sent by
Hey I have code that wires up the tabs in the Ready function for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.