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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:17:25+00:00 2026-05-26T03:17:25+00:00

My backend coder provided me with curl example of file uploading: curl -v -F

  • 0

My backend coder provided me with curl example of file uploading:

curl -v -F dictation_file=@file.name -F category=1 http://my.server.com/files/create/

I’m using AFNetworking and the following code is not working:

NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setObject:title forKey:@"title"];
    [parameters setObject:category forKey:@"category"];

    NSMutableURLRequest *request = [self multipartFormRequestWithMethod:@"POST" 
                                                                   path:@"files/create/" 
                                                             parameters:parameters 
                                              constructingBodyWithBlock:^(id <AFMultipartFormData> formData) {
                                                  NSData *data= [NSData dataWithContentsOfFile:record.filePath];
                                                  [formData appendPartWithFileData:data mimeType:@"application/octet-stream" name:@"dictation_file"];
                                              }];

    AFHTTPRequestOperation *operation = [AFHTTPRequestOperation operationWithRequest:request 
                                                                          completion:^(NSURLRequest *request, NSHTTPURLResponse *response, NSData *data, NSError *error) 
    { // handlecodehere
}];

However in response json i receive information that dictation_file field is empty. May be i don’t understand curl?
@file.name simply substitude encoded data in field, right?

  • 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-26T03:17:25+00:00Added an answer on May 26, 2026 at 3:17 am

    I had to modify appendPartWithFileData:mimeType:name: method.

    On this line

    [mutableHeaders setValue:[NSString stringWithFormat:@"file; name=\"%@\"; filename=\"%@\"", name, fileName] forKey:@"Content-Disposition"]; 
    

    instead of file i wrote form-data.

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

Sidebar

Related Questions

In my SQL Server backend for my app, I want to create history tables
c#.Net 3.5 with a SQL Server 2000 backend, I have a connection string in
I'm writing a Stack Overflow API wrapper , currently at http://soapidotnet.googlecode.com/ . I have
Referring to the below link: http://www.javaworld.com/javaworld/jw-11-1998/jw-11-techniques.html?page=2 The composition approach to code reuse provides stronger
I have a web app which talks to a custom back-end server over HTTP.
The code below gets the username/password and runs it thru the backend.php script. <?php
Does anyone have some good hints for writing test code for database-backend development where
I've always backed up all my source codes into .zip files and put it
A legacy backend requires the email body with a .tif document, no tif and
I have from the backend a time on the format 00:12:54 and I display

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.