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 6583491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:24:58+00:00 2026-05-25T16:24:58+00:00

I am trying so much to upload the image and video with other data

  • 0

I am trying so much to upload the image and video with other data But not success how can I do that .
My app is like that i have take data from the sqlite database and I want to that data which i am gettig from the sqlite .And for image have only the url .
Before that I done sync with the normal data .But image and video i have no idea how can do that .
For sync or uploading data i done code
Like this

-(void)sendRequest
{

    NSDate* date = [NSDate date];
    //Create the dateformatter object
    NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease];
    //Set the required date format
    [formatter setDateFormat:@"dd-MMM-yyyy"];
    //Get the string date
    NSString* str = [formatter stringFromDate:date];

    NSString *post = [NSString stringWithFormat:@"Token=%@&LocationID=%@&JourneyID=%@&Altitude=%@&Longitude=%@&Latitude=%@&Speed=%@&Accuracy=%@&LocationDate=%@&LastSyncDate=%@",tokenapi,Location_ID,Journey_jlID,Altitude_jl,Longitude_jl,Latitude_jl,Speed_jl,Accuracy_jl,LocationDate_jl,str];
    NSLog(@"%@",post);
    NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; 
    postLength = [NSString stringWithFormat:@"%d", [postData length]]; 
    NSLog(@"%@",postLength);
    NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init]autorelease]; 
    [request setURL:[NSURL URLWithString:@"http://www.google.com?RequestType=UserJourneyLocation&Command=NEW"]]; 
    NSLog(@"%@",request);
    [request setHTTPMethod:@"POST"]; 
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; 
    [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; 
    [request setHTTPBody:postData];

    NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

    if (theConnection) {
        webData = [[NSMutableData data] retain];
        NSLog(@"%@",webData);

    }


}

But how can send the multiple data to server with image and video data

  • 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-25T16:24:59+00:00Added an answer on May 25, 2026 at 4:24 pm

    Please try this to post the data on server.

    NSError *error = nil; 
    
    NSHTTPURLResponse *response = nil; 
    
    NSURL *url = [NSURL URLWithString:POST_URL]; 
    
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; 
    
    NSString *boundary = @"-------------------a9d8vyb89089dy70"; 
    
    NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary]; 
    
    [request setHTTPMethod:@"POST"];  
    
    [request setValue:contentType forHTTPHeaderField:@"Content-Type"];
    
    [postBody appendData:[[NSString stringWithFormat:@"--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]]; 
    
    [postBody appendData:[@"Content-disposition: form-data; name=\"contentID\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; 
    
    [postBody appendData:[@"127_8_1315579702522" dataUsingEncoding:NSUTF8StringEncoding]]; 
    
    [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
    
    ......
    
    // Pass here your other Paramater as like Content ID
    
    ......
    
    [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
    
    [postBody appendData:[[NSString stringWithFormat:@"Content-disposition: form-data; name=\"image_file\"; filename=\"%@\"\r\n",@"image.jpg"] dataUsingEncoding:NSUTF8StringEncoding]];
    
    [postBody appendData:[@"Content-Type: image/jpg\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
    
    [postBody appendData:ImageDataPost];
    
    [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
    
    [request setHTTPBody:postBody];
    
    NSData *shoutData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload the image using the webservices and Base64string. But each
I'm trying to create a WP7 application that will upload an image to my
I’m trying to upload files to Amazon S3 using AWS::S3 , but I’d like
Trying to parse some XML but apparently this is too much for a lazy
I'm trying to use jQuery UI tabs much like a Master Page in ASP.Net.
I'm trying to reduce as much as I can my VB.Net assembly side, and
I'm trying to understand regex as much as I can, so I came up
I have a working Ajax form, now I'm trying to add file upload to
I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I
i'm trying to upload my app engine project for the very first time and

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.