Is it possible to upload a file to server without converting it into NSData?

喜夏-厌秋 提交于 2019-12-22 09:17:57

问题


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??

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.


回答1:


Networks are analogue and computer and devices are digital they not understand what is what for them all the things are digital data so I guess now you understand its simply not possible, If you are having any specific problem of converting your file into data and the getting them back, you can go ahead




回答2:


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)



来源:https://stackoverflow.com/questions/20417347/is-it-possible-to-upload-a-file-to-server-without-converting-it-into-nsdata

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!