So I have an application that currently upload images to a web service using a multipart form and I do this pretty simply using an NSMutableRequest and NSURLConnection. The problem I seem to be coming into though is I want to be able to upload a given file without loading it into the program as an NSData object, but simply from the file path. I have heard that this is possible and I know the ASIHTTPRequest seems to do it. Any help would be much appreciated! Thank you!
You're mistaken. You can't just send a file path to the remote server, because the server would still just have the path, but none of the contents of the file. Even ASIHTTPRequest is still reading the file into memory and creating the HTTP request with the file contents in the request body. They just have a nicer API for doing it.
So technically, you can just post a file by providing a path to ASIHTTPRequest, but ASIHTTPRequest is just doing the dirty work for you. At some point you're going to have to load the file into memory.
An alternative would be to create a custom NSInputStream
subclass (let's call it HTTPPostStream) that dynamically builds the HTTP POST body, given some file paths and what not. Then it could stream bytes directly off the disk and into the outgoing request, saving you from loading a large file into memory. This will be more work, but you won't have to worry about loading a 2GB file into memory.
For simplicity, though, ASIHTTPRequest looks pretty decent.