Is it possible to submit a file from within Cocoa? What I mean is that I have a file on the client’s side which I want uploaded to my server as if I selected it in a upload field in HTML. Then, I need to show the response the server sent in a text field.
Is this possible at all, and if so, can I show the progress on a progress bar? I do have the code to send a regular POST request, but I just don’t know how to go about sending a file effectively to a server-side PHP script.
Thanks for any help!
You can submit a content of a file like this:
Response served by your PHP script can be retrieved by delegates (all must be implemented, see NSURLConnection documentation for details, there is an example):