iphoneajaxioscocoa-touchnsconnection

upload image using objective-c


I'm writing an iPhone app for a web service and I need to upload image to the service. In the web version, it's using AJAX. But I know little about that. I find the following code on the web page for the upload button:

        if (button.length) {
        new AjaxUpload(button, {
            action: '/Media/UploadFile',
            responseType: 'json',
            onSubmit: function (file, ext) {
                $('#bBar').progressBar(0);
                var uid = createUUID();
                timerID = setTimeout(function () { checkImageUploadProgress(uid, 1, 'image') }, 1000);
                startUpload();
                this.setData({ fileType: 1, guid: uid, DJUploadStatus: '::DJ_UPLOAD_ID::' + uid });
            },
            onComplete: function (file, response) {
            }
        });
    }

How should I implement this function using the NSConnection class?


Solution

  • FTP vs HTTP upload on iPhone

    upload image from iPhone application

    Upload image along with other data in same POST

    iPhone UIImage upload to web service

    And there's plenty more. I'm sure you'll manage to do it the answers to these questions.