views:

274

answers:

1

I am using following code to get bytes array. thx to this post.

Data *data = [NSData dataWithContentsOfFile:filePath];
NSUInteger len = [data length];
Byte *byteData = (Byte*)malloc(len);
memcpy(byteData, [data bytes], len);

it is the right method to do so?

Now, How i can pass bytes array into url?

Thank You for Help,

A: 

You're using the right method to extract the raw bytes from the data. To get those into a URL, you'll need to convert them to a string. Exactly what string depends on the format that you're submitting (ie. it could be just a list of 1s and 0s, or YES and NO, or any other character(s) as required by the server you're talking to.)

Ben Gottlieb
Hey thank you Ben,But i have large data to send that's y i am converting into bytes,any idea how can i do it?
Jindal
Without knowing what the server is expecting, there's no way to answer this question.
Ben Gottlieb
Jindal