是否可以将文件上传到服务器而不将其转换为NSData? [英] Is it possible to upload a file to server without converting it into NSData?

查看:147
本文介绍了是否可以将文件上传到服务器而不将其转换为NSData?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,我必须从设备上传文件到服务器,我知道如何使用以下 NSMutableURLRequest 将文件发送到服务器,但它是否可能将文件存储到服务器而不转换为 NSData ??

I am developing an app in which I have to upload a file to server from device, i know how to send file to server using following NSMutableURLRequest , but is it possible to store file to server without converting to NSData??

我见过如何将图像上传到asp.net服务器而不转换为iPhone中的NSData 这个问题,但没有找到任何解决方案。

I have seen How upload image in to asp.net server without converting into NSData in iPhone this question but didn't find any solution.

推荐答案

网络上的数据总是以字节为单位,无论是否有任何平台。在发送之前,NSData最终会转换为字节数据它通过网络..在更高级别,您的数据应该是NSData格式,但在较低级别它的字节数。所以在ios中它将是数据字节(如果您使用NSInputstream上传数据)或NSData(最终将再次转换为字节并通过网络发送)

The data on a network always flows in Bytes irrespective of any platform.. NSData will finally be converted to bytes data before sending it over network.. On higher level your data should be in NSData format but on lower level its on Bytes.. So in ios it will be either Bytes of Data (if you are using NSInputstream to upload data) or NSData (which will finally converted to Bytes again and sent over the Network)

这篇关于是否可以将文件上传到服务器而不将其转换为NSData?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆