how to upload image dynamically on server?

后端 未结 2 944
-上瘾入骨i
-上瘾入骨i 2021-01-16 07:21

In my application i want to upload the images to server.

I am able to upload images on server but the name of the image mention in front of filename=%@.jpg. remains

2条回答
  •  [愿得一人]
    2021-01-16 07:43

    this line [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@.jpg\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];

    Content-Type: image/jpeg

    instead of Content-Disposition: form-data

    and learn how to use content type

提交回复
热议问题