问题
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