Skip to content
Advertisement

Uploading an mp3 to my (php based) web server from an iPhone app

I’m looking to upload an mp3 file from my iPhone app to a given php page. To do this I found the ASIFormDataRequest class. Now I made a piece of code in my app like so:

JavaScript

However I can’t figure out how to put my NSURL which points to the mp3 inside this request. I have tried the above, but couldn’t find anything that points me in the right direction.. Any ideas?

The code that receives the request is like so:

JavaScript

Advertisement

Answer

Here:

JavaScript

I think you should use [soundFileURL path] instead of [soundFileURL absoluteString], as [request setFile:] expects a filepath, not a full URL.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement