views:

536

answers:

3

Hello,

I have an application which uploads file from iPhone to web server.

Problem is that I want to give users a control like from which they can select the file / photo from the device and which is than uploaded on server.

Can anyone help me

+1  A: 

I think you want to use an ImagePickerController that is the system component to allow a user to choose a photo.

Toby Allen
I have tried to use the same, but I can't get the path of the Image I select. Please can you help me.
pratik
+1  A: 

You can get the UIImage content as a JPEG or PNG wrapped in NSData:

NSData *data = UIImageJPEGRepresentation(image, 1);
if( data ) {  // it's possible nil may be returned
    ;// do stuff here. 
    // see: link to other answer on SO below.
    // if you want to write to file, try:
    [data writeToFile:filePath atomically:YES];
}

http://stackoverflow.com/questions/936855/file-upload-to-http-server-in-iphone-programming

wkw
How is this an answer to the question?
Arne Evertsson
I suspect it was more about the link provided below sample code...
wkw
A: 

hi partick ,

Can you please update me for the same i am also trying to upload a image from sdk to webserver.

Thanks,

Sajid

Sonu