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

  • Home
  • SEARCH
  • 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 6683131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:47:08+00:00 2026-05-26T04:47:08+00:00

-(IBAction)pushUpload{ NSData *media = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@Movie ofType:@m4v]]; NSString *urlString = @http://api.twitpic.com/api/upload; NSString

  • 0
-(IBAction)pushUpload{

    NSData *media = [NSData dataWithContentsOfFile:[[NSBundle mainBundle]   pathForResource:@"Movie" ofType:@"m4v"]];

   NSString *urlString = @"http://api.twitpic.com/api/upload";

   NSString *key = @" ";
   NSString *message =messagetext.text;


NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];

NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request addValue:contentType forHTTPHeaderField:@"Content-Type"];

NSMutableData *body = [NSMutableData data];
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
 NSString *username = [prefs stringForKey:@"keyToLookupString"];
NSString *password = password.text;
NSUserDefaults *prefs2 = [NSUserDefaults standardUserDefaults];
[prefs2 setObject: password forKey:@"keyToLookupString2"];

// username part
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"username\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[username dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];

// password part
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"password\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[password dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];

// key part
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"key\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[key dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];


// message part
[body appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"message\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[message dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];

//media part
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"media\"; filename=\".m4v\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[NSData dataWithData:media]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];


[request setHTTPBody:body];


NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
NSLog(@"response is:%@",returnString);

}

` I am trying to uplaod video file to the specified url of twit pic which helps the user to upload their videos to twitter. When i press button video file should upload into the url which i used. but when i check,getting a response that the page you requested could not be found.Has anyone tried to upload videos to twit pic. Please give me some sample codes.Thanks in advance.

  • 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-05-26T04:47:08+00:00Added an answer on May 26, 2026 at 4:47 am

    the error is related to the incorrect urlString. I also dont see which twitpic-api-version you are using.

    twitpic-api-version-2 (latest api-version this should be used) needs authorization first via OAuth and api-key, message and media as parameters
    urlString should look like: http://api.twitpic.com/2/upload.xml

    twitpic-api-version-1 (not the latest one: only there because of compability. Will be shut down sometime in future) needs the parameters you added but also two additional oauth-parameter which are missing in your body.
    urlString should look like: http://api.twitpic.com/1/upload.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

- (IBAction)sendMessage:(id)sender { NSString* conversationFile = [@~/ stringByAppendingPathComponent:@conversation.txt]; BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:conversationFile];
enter code here-(IBAction)Call:(id)sender{ //[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@tel://18005551234]]; /*NSString *phoneStr = [[NSString alloc] initWithFormat:@tel:%@,phoneNumber.text]; NSURL
I have a IBAction such as: - (IBAction)showPicker:(id)sender; How can I get the name
-(IBAction)restart{ ....... } How can I restart a application when I pressed a button?
-(IBAction)bigger { must.bounds.size = CGSizeMake(must.bounds.size.width +5.0 , must.bounds.size.height +5.0); } This is the code
So I have an IBAction: - (IBAction)yesNo { int rNumber = rand() % 26;
I have an IBAction that displays what is being pressed on certain buttons to
I have this code: -(IBAction) doSomething{ FirstViewController *firstViewController = [[[FirstViewController alloc]init]autorelease]; [firstViewController.label1 setAlpha:1.00]; [firstViewController.label2
So I have an IBAction yesNo that I want to be ran on a
I have a IBAction UILabel to add a number every time it is pressed.

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.